Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch away from footnote-style linking #65

Open
jywarren opened this issue Nov 25, 2020 · 6 comments
Open

Switch away from footnote-style linking #65

jywarren opened this issue Nov 25, 2020 · 6 comments

Comments

@jywarren
Copy link
Owner

jywarren commented Nov 25, 2020

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:

Hello [world][1]

1. https://world.com

This can cause issues when switching back and forth from HTML to Markdown, so we'd prefer the more basic style:

Hello [world](https://world.com)

We can now write a Jest test for it!

This may also be the case for image markdown URLs.

@jywarren jywarren added the bug label Nov 25, 2020
@jywarren
Copy link
Owner Author

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)

@jywarren
Copy link
Owner Author

@Sagarpreet
Copy link

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!

@Sagarpreet
Copy link

Also Noting:

Attachments are not working in markdown but are working in rich mode!

@Sagarpreet
Copy link

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")

@jywarren
Copy link
Owner Author

jywarren commented May 4, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants