-
-
Notifications
You must be signed in to change notification settings - Fork 255
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
Allow rendering messages as plaintext #805
Conversation
ab14056
to
4929c61
Compare
da0fd69
to
de98770
Compare
cd3f638
to
e939176
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks great 🚀 .
Btw what docs I can use to review markdown.js in more detail.
shrug: { | ||
order: defaultRules.escape.order - 0.1, | ||
match: inlineRegex(/^¯\\_\(ツ\)_\/¯/), | ||
parse: (capture) => ({ type: 'text', content: capture[0] }), | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering why we have a shrug rule?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this allows the shrug to no loose his left arm due to it parsing it as markdown (the first \
disappearing as it escapes the _
after it). now smb can just paste in a shrug in or use the /shrug
command without having to worry about markdown behaving weirdly.
fence: { | ||
...defaultRules.fence, | ||
match: blockRegex(/^ *(`{3,}|~{3,}) *(?:(\S+) *)?\n([\s\S]+?)\n?\1 *(?:\n *)*\n/), | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is fence?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a code fence which is a codeblock surrounded by ```
. this gets converted into a codeBlock
after parsing.
25b3df9
to
3069f0d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. This works great now 🚀
* Parse room input from user id and emoji * Add more plain outputs * Add reply support * Always include formatted reply * Add room mention parser * Allow single linebreak after codeblock * Remove margin from math display blocks * Escape shrug * Rewrite HTML tag function * Normalize def keys * Fix embedding replies into replies * Don't add margin to file name * Collapse spaces in HTML message body * Don't crash with no plaintext rendering * Add blockquote support * Remove ref support * Fix image html rendering * Remove debug output * Remove duplicate default option value * Add table plain rendering support * Correctly handle paragraph padding when mixed with block content * Simplify links if possible * Make blockquote plain rendering better * Don't error when emojis are matching but not found * Allow plain only messages with newlines * Set user id as user mention fallback * Fix mixed up variable name * Replace replaceAll with replace
Description
This refactors the way sending messages (with edits and replies) is handled in
RoomsInput.js
and adds plaintext rendering of messages (plain and markdown). This allows for hiding spoilers in plain messages in the future. For now this moves mention and emoji to be parsing over tosimple-markdown
.Fixes #770
Fixes #746
Type of change
Checklist:
Preview: https://805--pr-cinny.netlify.app
⚠️ Exercise caution. Use test accounts. ⚠️