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

Don't add snippet if the link was in a quote #240

Open
orklah opened this issue Sep 22, 2020 · 3 comments
Open

Don't add snippet if the link was in a quote #240

orklah opened this issue Sep 22, 2020 · 3 comments

Comments

@orklah
Copy link

orklah commented Sep 22, 2020

When a user quote a previous reply that contains a psalm.dev link, the bot will reply with links already posted. This should be a matter of checking if there's no ">" character on the beggining of the line

@weirdan
Copy link
Member

weirdan commented Sep 22, 2020

Markdown blockquotes are a bit more complex

> Blockquote
line
can
be
   continued
   > up to three spaces are allowed before `>`
    > and four spaces make it a code block

The above is rendered as:

Blockquote
line
can
be
continued

up to three spaces are allowed before >

> and four spaces make it a code block

So using a proper parser (e.g. commonmark.js) might be a better bet.

@orklah
Copy link
Author

orklah commented Sep 22, 2020

I had no idea this was this complex.

Not sure if it's a good idea anymore :D

@weirdan
Copy link
Member

weirdan commented Sep 22, 2020

Another interesting case is footnote-style links, where the link reference might be in a quote, but the link URL is technically outside:

> Footnote [link][1]

[1]: https://example.org "Example Org"

Rendered as

Footnote link

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

No branches or pull requests

2 participants