You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When feeding it with input using the following script: (deemed more overviewable than any more verbose example I would be able to produce in pure javascript)
#!/bin/sh -eu
working_desc='Markdown with one hyperlink works as expected:'
working_md='Markdown may contain [hyper links](https://example.com/) '
broken_desc='As soon as one adds a second one it breaks though:'
broken_md="$(echo'Markdown may contain [hyper links](https://example.com/) ' \'note that plural means more than merely one [link](https://example.org/)')"
workaround_desc='Working around it?:'
workaround_md="$(printf'%s\\n\\n%s\\n' \'Adding hard paragraph breaks [hyper links](https://example.com/)' \'seems to be a work around [link](https://example.org/)')"forexamplein working broken workaround;doecho$(evalecho"\$${example}_desc")echo"$(evalecho"\$${example}_md")"| ./md2adf.js
echodone
Running the above gives the following output:
Markdown with one hyperlink works as expected:
{"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"Markdown may contain "},{"type":"text","text":"hyper links","marks":[{"type":"link","attrs":{"href":"https://example.com/"}}]}]}],"version":1}
As soon as one adds a second one it breaks though:
{"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"Markdown may contain [hyper links](https://example.com/) note that plural means more than merely one "},{"type":"text","text":"link","marks":[{"type":"link","attrs":{"href":"https://example.org/"}}]}]}],"version":1}
Working around it?:
{"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"Adding hard paragraph breaks "},{"type":"text","text":"hyper links","marks":[{"type":"link","attrs":{"href":"https://example.com/"}}]}]},{"type":"paragraph","content":[{"type":"text","text":"seems to be a work around "},{"type":"text","text":"link","marks":[{"type":"link","attrs":{"href":"https://example.org/"}}]}]}],"version":1}
I did briefly open up the source code, but got reminded immediately that javascript isn't my language. All I noticed was that the library appears to do string matching in markdownParsing.js rather than using some kind of context aware parsing engine. Without being an expert, I suspect that is a too simplistic approach for more than the most simple use cases.
Regarding the workaround; Having to add hard paragraph breaks is not ideal, but removing those manually is at least a lot less work than fiddling with hyperlinks in Atlassians web browser interface.
The text was updated successfully, but these errors were encountered:
This is similar to #12 and #27, but different enough to mandate its own ticket.
Consider the following script
md2adf.js
taking markdown on stdin and giving adf on stdout. I.e. one of the simplest possible uses of this library:When feeding it with input using the following script: (deemed more overviewable than any more verbose example I would be able to produce in pure javascript)
Running the above gives the following output:
I did briefly open up the source code, but got reminded immediately that javascript isn't my language. All I noticed was that the library appears to do string matching in markdownParsing.js rather than using some kind of context aware parsing engine. Without being an expert, I suspect that is a too simplistic approach for more than the most simple use cases.
Regarding the workaround; Having to add hard paragraph breaks is not ideal, but removing those manually is at least a lot less work than fiddling with hyperlinks in Atlassians web browser interface.
The text was updated successfully, but these errors were encountered: