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

Parse link reference definitions surrounded by angle brackets #476

Merged
merged 1 commit into from
Feb 10, 2023

Conversation

ElliotFriend
Copy link
Contributor

I created issue #475, and it seemed like a simple enough change, I wanted to take a stab at solving it. I've adjusted the regex, and added some tests to allow angle brackets to surround link reference definitions, like this one:

This is [an example][id] reference-style link.

[id]: <http://example.com/>  "Optional Title Here"

All tests are passing. There is one CommonMark syntax feature I couldn't quite get working. Empty link definitions are supposed to be allowed, using angle brackets like so:

[foo]: <>
[foo]

This should produce:

<p><a href="">foo</a></p>

I couldn't get the regex to work quite right, so I've left that unimplemented.

Please let me know if this PR is helpful, or if there's any changes you'd like. Thanks!

I created issue quantizor#475, and it seemed like a simple enough change,
I wanted to take a stab at solving it. I've adjusted the regex,
and added some tests to allow angle brackets to surround link
reference definitions, like this one:

```markdown
This is [an example][id] reference-style link.

[id]: <http://example.com/>  "Optional Title Here"
```

All tests are passing.

Signed-off-by: Elliot Voris <elliot@voris.me>
Copy link
Owner

@quantizor quantizor left a comment

Choose a reason for hiding this comment

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

Lgtm thanks!

@quantizor quantizor merged commit 5bd4503 into quantizor:main Feb 10, 2023
Innei pushed a commit to Innei/markdown-to-jsx that referenced this pull request Aug 2, 2023
…zor#476)

I created issue quantizor#475, and it seemed like a simple enough change,
I wanted to take a stab at solving it. I've adjusted the regex,
and added some tests to allow angle brackets to surround link
reference definitions, like this one:

```markdown
This is [an example][id] reference-style link.

[id]: <http://example.com/>  "Optional Title Here"
```

All tests are passing.

Signed-off-by: Elliot Voris <elliot@voris.me>
Signed-off-by: Innei <i@innei.in>
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

2 participants