snudown icon indicating copy to clipboard operation
snudown copied to clipboard

Added nolinks flag to skip links during rendering

Open debuggio opened this issue 7 years ago • 17 comments

👓 @pwildani @lan17

debuggio avatar Mar 07 '17 19:03 debuggio

:haircut:

debuggio avatar Mar 09 '17 01:03 debuggio

Can you also describe the business logic of this as well as the reasoning behind this change in the OP?

lan17 avatar Mar 10 '17 20:03 lan17

I've introduced a feature that if subreddit is specific list and someone mentioned user or subreddit in comments for post in this subreddit, users won't receive messages that someone mentioned their name. Because we assume that this subreddit is spamming we decided to also disable link rendering for this subreddit

debuggio avatar Mar 10 '17 22:03 debuggio

This is just the render part, right? Where is the business logic code that decides which subs to use this new renderer for?

lan17 avatar Mar 10 '17 22:03 lan17

https://github.com/reddit/reddit-public/pull/6501

debuggio avatar Mar 10 '17 22:03 debuggio

:haircut: you are right. refactored snudown.c and snudown-validator.c

debuggio avatar Mar 11 '17 00:03 debuggio

👓 @spladug @JordanMilne

I haven't reviewed the current version yet, but the goal is to allow disabling user and subreddit mentions on a per-subreddit basis as a penalty for abusing the feature. Disabling all automatic links might be reasonable fallout.

Butler's notifications are handled in a separate PR.

pwildani avatar Mar 13 '17 17:03 pwildani

If the intent is to disable all linking from posts under this new rendering mode we should add testcases to ensure the other forms of links are rendered as plaintext as well:

  • [foo](/u/bar)
  • </u/foobar>

JordanMilne avatar Mar 17 '17 19:03 JordanMilne

💅 Some questions RE how regular links should behave

JordanMilne avatar Mar 17 '17 20:03 JordanMilne

:haircut:

debuggio avatar Mar 28 '17 17:03 debuggio

💅 I have a followup to jordan's question about links.

I realize this is under-defined, but IMO, the syntax is an explicit link and therefore needs a separate flag from the AUTOLINK flag to disable.

I haven't given enough thought to if we should disable all links as a penalty yet, just the automatic ones.

pwildani avatar Mar 28 '17 17:03 pwildani

1 thing about links and why I've moved if (md->cb.image || md->cb.link) under if (extensions & MKDEXT_AUTOLINK): Jordan suggested test case foo. Without my change it is rendered as foo. That I think is what we are trying to avoid. If you think that it's ok to render such links, than I agree that it's more clearer to remove revert this change

debuggio avatar Mar 28 '17 23:03 debuggio

:haircut:

debuggio avatar Mar 29 '17 00:03 debuggio

🐟

pwildani avatar Apr 12 '17 20:04 pwildani

🐟

lan17 avatar Apr 14 '17 19:04 lan17

OMG, this is still open?!

lan17 avatar Sep 15 '17 22:09 lan17

Woah. close this plz@

lan17 avatar Oct 19 '18 04:10 lan17