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

Support optional markdown rendering in client #20

Open
aarchiba opened this issue May 22, 2019 · 0 comments
Open

Support optional markdown rendering in client #20

aarchiba opened this issue May 22, 2019 · 0 comments
Labels
feature This is a brand new feature request

Comments

@aarchiba
Copy link

A simple way of allowing users to emphasize words and indicate that something is code (and have monospaced text) would be to render incoming posts that contain markdown. Some users may not want this at all. Others may want to turn it on or off for individual posts. I suggest adding a checkbox to the bottom of each post to allow the user to turn markdown rendering on/off. The default would be drawn from user preferences. Perhaps the preference setting would also include an option for "never show the checkbox".

Only a subset of Markdown need be rendered; if there is reasonable difference about exactly how much, this makes another user preference. Natural subsets: bold, italics, monospace, underline only; anything with no external references (e.g. no embedded images). Links we already support. Of particular note is whether to render multiline code blocks as these will be used to make ASCII art more readable.

This is how MathJAX is implemented on the arXiv: if you want mathematics in your paper's abstract, you write it as normal LaTeX between $ $ (as normal; $e^{i\pi}+1 = 0$). Clients have the option of rendering it (with a Javascript library). In some contexts it will never (?) be rendered: the daily mailings of abstracts go out containing it. But the intended audience is accustomed to reading mathematics in this form (and there is no simpler form it could really be in if it were not aimed at MathJAX).

The argument for being able to turn off rendering for individual posts is that occasionally markdown rendering mangles a post that was not intended to be markdown (for example if a single paragraph contains two asterisks). We should not require users who don't want markdown to quote against it. But there could instead be a checkbox that could apply to all posts; users using markdown would hit it to decipher a mangled post then again to turn their markdown back on.

Libraries exist to handle the rendering; ShowdownJS is one example, though whether it has the flexibility to handle subsets I can't say. So implementation should be a matter of gluing an appropriate library in to the Mastodon client code.

@robinmaypanpan robinmaypanpan added the feature This is a brand new feature request label May 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This is a brand new feature request
Projects
None yet
Development

No branches or pull requests

2 participants