Dialogue text formatting ("-" instead of "•")

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?

Yes, put a backslash \ before the dash -

Like so

\- Hello, how are you?
\- I’m pretty good, thanks.

which renders as

- Hello, how are you?
- I’m pretty good, thanks.

2 Likes

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?

For old posts you can use the rails c console to replace - with \-

rake posts:remap["find","replace"]

but you need to use regex to change only - (followed by an empty space?) and not for example - used in links or in other situations.

1 Like

I don’t wanna sound negative, but I have absolutely no idea how this is going to work. I have 0 experience with programming, coding and all that.

Just need a simple dialogue with dashes as it is in books and websites. I just don’t feel like hiring a developer for something not so big.

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.

3 Likes

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.

7 Likes