Skip to content

feat(markdown-docx): add link transformer - #397#436

Merged
algomaster99 merged 6 commits intoalgoo-ooxmlfrom
k-kumar-01/i397/link-transformer
Aug 9, 2021
Merged

feat(markdown-docx): add link transformer - #397#436
algomaster99 merged 6 commits intoalgoo-ooxmlfrom
k-kumar-01/i397/link-transformer

Conversation

@K-Kumar-01
Copy link
Copy Markdown
Collaborator

Signed-off-by: k-kumar-01 kushalkumargupta4@gmail.com

Add the transformation logic for link.

Changes

  • transformation logic: OOXML<->CiceroMark
  • rules: link and link property
  • tests: link and its variants

Flags

  • Syntactical differences may occur. Example case: strong->hyperlink->text will always get converted to hyperlink->strong->text

Author Checklist

  • Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.
  • Vital features and changes captured in unit and/or integration tests
  • Commits messages follow AP format
  • Extend the documentation, if necessary
  • Merging to master from fork:branchname

transformation logic: OOXML<->CiceroMark
rules: link and link property
tests: link and its variants

Signed-off-by: k-kumar-01 <kushalkumargupta4@gmail.com>
Signed-off-by: k-kumar-01 <kushalkumargupta4@gmail.com>
@K-Kumar-01 K-Kumar-01 added this to the Implement link milestone Aug 5, 2021
Copy link
Copy Markdown
Contributor

@algomaster99 algomaster99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to render the generated OOXML in MS Word but I didn't see any of the links behave like actual links. I am assuming they are supposed to redirect me somewhere when I click on them. What should be the actual behaviour?

link

Comment thread packages/markdown-docx/src/ToCiceroMarkVisitor.js
@K-Kumar-01
Copy link
Copy Markdown
Collaborator Author

K-Kumar-01 commented Aug 6, 2021

I tried to render the generated OOXML in MS Word but I didn't see any of the links behave like actual links. I am assuming they are supposed to redirect me somewhere when I click on them. What should be the actual behaviour?

link

@algomaster99
I have generated the OOXML and on click it opens a tab in my Chrome with the url specified in the link.
Screenshot (112)

Comment thread packages/markdown-docx/src/ToOOXMLVisitor/index.js Outdated
Comment thread packages/markdown-docx/src/ToOOXMLVisitor/index.js Outdated
Comment thread packages/markdown-docx/src/ToOOXMLVisitor/index.js Outdated
Comment thread packages/markdown-docx/src/ToCiceroMarkVisitor.js Outdated
Signed-off-by: k-kumar-01 <kushalkumargupta4@gmail.com>
@K-Kumar-01 K-Kumar-01 requested a review from algomaster99 August 6, 2021 18:18
@K-Kumar-01
Copy link
Copy Markdown
Collaborator Author

@algomaster99
Made some changes. Let me know if any more changes are required.

Comment thread packages/markdown-docx/src/ToCiceroMarkVisitor.js
Comment thread packages/markdown-docx/src/ToOOXMLVisitor/index.js Outdated
Comment thread packages/markdown-docx/src/ToOOXMLVisitor/index.js Outdated
Comment thread packages/markdown-docx/src/ToOOXMLVisitor/index.js Outdated
Comment thread packages/markdown-docx/src/ToOOXMLVisitor/index.js Outdated
Signed-off-by: k-kumar-01 <kushalkumargupta4@gmail.com>
@K-Kumar-01 K-Kumar-01 requested a review from algomaster99 August 6, 2021 21:33
Comment thread packages/markdown-docx/src/ToCiceroMarkVisitor.js Outdated
Comment thread packages/markdown-docx/src/ToOOXMLVisitor/index.js Outdated
Comment thread packages/markdown-docx/src/ToOOXMLVisitor/index.js Outdated
Comment thread packages/markdown-docx/src/ToOOXMLVisitor/index.js
Comment thread packages/markdown-docx/src/ToOOXMLVisitor/index.js Outdated
@@ -0,0 +1,36 @@
{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of your other test cases are uglified. Any specific reason to prettify this?

I would prefer it prettified, to be honest, but I thought you deliberately wanted to keep all the uglified when you wrote the first test case.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@algomaster99
I might have missed this thing.
I can prettify the test cases in a different PR.

improve variable naming
group the for loops and relationship tags construction
minify link.json

Signed-off-by: k-kumar-01 <kushalkumargupta4@gmail.com>
@K-Kumar-01 K-Kumar-01 requested a review from algomaster99 August 8, 2021 11:58
Copy link
Copy Markdown
Contributor

@algomaster99 algomaster99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final changes and then we can merge.

Comment thread packages/markdown-docx/src/ToCiceroMarkVisitor.js
Comment thread packages/markdown-docx/src/ToCiceroMarkVisitor.js Outdated
Comment thread packages/markdown-docx/src/ToOOXMLVisitor/helpers.js
Comment thread packages/markdown-docx/src/constants.js
Comment thread packages/markdown-docx/src/ToOOXMLVisitor/index.js Outdated
Signed-off-by: k-kumar-01 <kushalkumargupta4@gmail.com>
@K-Kumar-01 K-Kumar-01 requested a review from algomaster99 August 9, 2021 11:42
@algomaster99 algomaster99 merged commit 12cf1a1 into algoo-ooxml Aug 9, 2021
@algomaster99 algomaster99 deleted the k-kumar-01/i397/link-transformer branch August 9, 2021 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants