The discussion revolves around formatting dialogue in a forum using dashes instead of bullet points. calebs explains that dashes followed by spaces are converted to bullet points, and asks for a solution. zogstrip suggests using a backslash before the dash ( ext) to preserve the dash, but calebs notes this is impractical for non-technical users. dax proposes using a Rails console command to replace dashes with escaped ones, but calebs finds this too complex. Stephen explains that altering Markdown rendering is not simple and suggests adopting a different syntax. tomtjes recommends using code blocks or double dashes as alternatives, and suggests creating a topic template to standardize formatting.
Hello. We have recently added a subcategory for literature, where people will need to use the following formatting in dialogues:
-Hello, how are you?
-I’m pretty good, thanks.
Unfortunately, when there is a space between the - and the text, it automatically turns into bullet points. Is there a way to fix that and keep them as dashes?
Thank you, but we can’t expect from all our forum members to know about the backslash. Is there another way to do it? It is ok to completely replace the bullets with dashes, if that is possible. Any suggestions?
You’re talking about overriding the formatting engine and breaking how part of markdown is rendered out, so while it doesn’t seem like a big change, it’s not something that can be easily altered, it’s certainly more than a line or two of code.
If you don’t want to change Discourse, then your best bet would be to adopt a different syntax; one which doesn’t collide with Markdown. Have you looked into alternatives? Scriptwriting for example doesn’t prepend lines of dialog with dashes.
Turns out, your best bet is probably to encourage your community to use a new standard. You could help them by creating a topic template in the category setting.
Aside from the backslash a couple other options:
Code blocks
Use three backticks ``` in a single line before and after the dialogue.
- Hello, how are you?
- I’m pretty good, thanks.
Use two dashes -- Hello, how are you?
– Hello, how are you? -- I’m pretty good, thanks.
– I’m pretty good, thanks.