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

Support citation style links #41

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

Necoro
Copy link

@Necoro Necoro commented May 10, 2020

This PR is similar to #32, with the following deviations:

  • only citation style links, no omitTableNodes etc
  • multiple links to the same URL get the same citation index (just as citations work :))
  • write directly into the buffer instead of string concatenation in a loop

Also, as a side effect, when determining where to add spaces, punctuation is taken into account. That is, no spaces are added before '?', ')', ... and no spaces are added after '(', '[', ...

Thus

Here is a <a href="http://example.com/">link</a> to some page. And <a href="http://google.com">another link</a>, too. 
And the <a href="http://example.com">first link</a> again.

renders as

Here is a link [1] to some page. And another link [2], too.
And the first link [1] again.

[1] http://example.com
[2] http://google.com

@Necoro Necoro closed this Jul 24, 2021
@Necoro Necoro deleted the branch jaytaylor:master July 24, 2021 11:17
@Necoro Necoro deleted the master branch July 24, 2021 11:17
@Necoro Necoro restored the master branch July 24, 2021 11:18
@Necoro
Copy link
Author

Necoro commented Jul 24, 2021

Sorry for the noise, Github did not work as I expected it to work :)

@Necoro Necoro reopened this Jul 24, 2021
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.

None yet

1 participant