Open jywarren opened 3 years ago
Test might look like:
insert this in HTML mode:
<a href="https://example.com">link</a>
and confirming it converts to:
[link](https://example.com)
Noting: The above url is incorrect, we need to change here: https://github.com/jywarren/woofmark/blob/plots2/src/markdown/linkOrImageOrAttachment.js
For images:
![image description][2]
[2]: /i/41849.png "Screenshot_2020-11-20_at_3.28.30_PM.png"
need to be converted to:
![image description](/i/41848.png "Screenshot_2020-11-20_at_3.28.30_PM.png")
Same for Hyperlinks!
Also Noting:
Attachments are not working in markdown but are working in rich mode!
For attachments
:
[WOW.pdf][attachment-1]
[attachment-1]: /i/41850.pdf "WOW.pdf"
Need to convert to:
[WOW.pdf](/i/41851.pdf "https://publiclab.org/i/41851.pdf")
Noting that i'm also seeing that dragging a PDF into https://publiclab.org/post generates:
testing this
[attachment-1]: /i/4.pdf "ConcealedHingeBasics.pdf"
and not:
testing this [attachment-1]
[attachment-1]: /i/4.pdf "ConcealedHingeBasics.pdf"
and so there is no originating text linking down to the attachment. If we could fix that, we might be in better shape, at least short term.
As noted in this test in the PublicLab.Editor project:
https://github.com/publiclab/PublicLab.Editor/blob/0daf8cba9a2e6d251ba2704d38235f9eff74a4fe/spec/javascripts/wysiwyg_spec.js#L27-L34
Woofmark uses a "footnote" style of linking, where the URLs are placed in a numbered list at the bottom, like:
This can cause issues when switching back and forth from HTML to Markdown, so we'd prefer the more basic style:
We can now write a Jest test for it!
This may also be the case for image markdown URLs.