snudown
snudown copied to clipboard
Added nolinks flag to skip links during rendering
👓 @pwildani @lan17
:haircut:
Can you also describe the business logic of this as well as the reasoning behind this change in the OP?
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
This is just the render part, right? Where is the business logic code that decides which subs to use this new renderer for?
https://github.com/reddit/reddit-public/pull/6501
:haircut: you are right. refactored snudown.c and snudown-validator.c
👓 @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.
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>
💅 Some questions RE how regular links should behave
:haircut:
💅 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.
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
:haircut:
🐟
🐟
OMG, this is still open?!
Woah. close this plz@