lbry-desktop/ui
infinite-persistence d91530b0c8 Markdown: don't convert '[label](uri)' to embeds.
## Issue
Closes 4936: Don't process markdown formatting as lbry:// url previews

## Approach
Preamble:
 - We want to convert plain `https://lbry.tv/befreeonlbry` to an embed, but not `[blah](https://lbry.tv/befreeonlbry)`.
 - At the markdown/remark level, both formats resolve to the same node type, having a `link` and a `text`, with the 'text' being auto-filled with the `href` if there is no label.

Fix by assuming the link is the non-labelled format if the `text` is the same as `href`.

This opens up one corner-case that we can't handle, which is when the user explicitly set the label using the href, e.g. `[https://lbry.tv/befreeonlbry](https://lbry.tv/befreeonlbry)`. This will still resolve to an embed. There's not enough data at the parsed level differentiate this case -- we would need to parse the content ourself before `remark`, which I think is not worth it.

## Aside/Reminder
If you see that the link doesn't resolve to an embed regardless of the format used, that's probably just due to `5636: Disable video previews in comments/posts made by channels below a certain channel staked level`
2021-03-15 13:31:17 -04:00
..
component Markdown: don't convert '[label](uri)' to embeds. 2021-03-15 13:31:17 -04:00
constants re-unify icons with master 2021-03-08 11:08:23 -05:00
effects fix bad lighthouse results 2021-01-28 15:35:15 -05:00
modal Handle remaining usages of MarkdownPreview 2021-03-12 10:38:16 -05:00
page only use new post styling for markdown 2021-03-12 11:54:37 -05:00
redux Don't clear all notifications when only 1 is clicked. 2021-03-08 11:41:04 -05:00
scss only use new post styling for markdown 2021-03-12 11:54:37 -05:00
util Fix timestamp regex error 2021-03-09 16:05:00 -05:00
analytics.js add videoFetchDuration to typedef 2021-03-09 16:04:40 -05:00
app.js refactor lbrytv web server 2019-11-11 13:27:29 -05:00
comments.js New moderation tools: block & mute (#5572) 2021-03-03 13:50:16 -05:00
i18n.js zh languages 2021-01-11 10:30:26 -05:00
index.jsx When a new reward is acquired, only close modals if the reward comes from reward_code 2021-01-08 08:16:41 -07:00
logWarningConsoleMessage.js new lbc icon 2020-09-29 17:12:32 -04:00
native.js working 2020-12-16 10:52:22 -05:00
reducers.js sync reducer stuff 2020-10-27 10:17:11 -04:00
rewards.js When a new reward is acquired, only close modals if the reward comes from reward_code 2021-01-08 08:16:41 -07:00
store.js New moderation tools: block & mute (#5572) 2021-03-03 13:50:16 -05:00