Backslash in web portal renders literally as MU's inline newline code

putting a \ in the webportal (tested in a custom profile tab and relationships) will render literally as %r

Typically, in some markdown flavors (haven’t checked the one and extensions Ares uses), used a below to create non-paragraph breaking spaces (just like the double space at the end of a line):

I am some wiki text \
and I want this to appear on the next line, single spaced

because if I didn't, like this line, it would appear with a space between

I couldn’t seem to find any documentation on this behavior and it was unexpected to me, so I have some questions…

Is there some use for being able to render %rs from the web portal that I’m missing (curious)?
Is there some way to escape it from this rendering but not from other wiki rendering?
Or at the very least, provide a literal \ that doesn’t use preformatted text markup (this is something I conventionally use for code, console output [when demonstrating the results of something], or to indicate commands)?

In advance, thank you!

1 Like

Yes, there’s some slightly odd parsing when you put a backslash at the end of a line. Basically it’s escaping the invisible “\n”, which then gets convered to an escaped “%R” when you save it to MUSH format.

But I don’t think you need it. Either of these options seems to be displayed the way you want:

In portal editor:

A regular linebreak
Next line

or

A MUSH linebreak%RNext line

Both get formatted so the text appears on the next line, in both the portal and the game:

A regular linebreak
Next line

A MUSH linebreak
Next line

Yeah but at what point would we ever want %r to actually be rendered to the web portal? That’s what’s happening here.

1 Like

Like why would text created in and rendered for the portal ever go through a rendering loop for the game and then be sent back to the portal? This just seems kinda weird to me. If text is intended for the portal, it should be rendered for the portal. If it’s intended for the game, it should be rendered for the game right? o_O

Forgive me. I haven’t poked around in your code yet, so I’m unstudied in how Ares handles this.

I’ll try to address your concerns from two angles. First:

Linebreaks in Markdown

Hard linebreaks in Markdown have a complicated history. The original syntax says:

The implication of the “one or more consecutive lines of text” rule is that Markdown supports “hard-wrapped” text paragraphs. This differs significantly from most other text-to-HTML formatters (including Movable Type’s “Convert Line Breaks” option) which translate every line break character in a paragraph into a <br /> tag.

When you do want to insert a <br /> break tag using Markdown, you end a line with two or more spaces, then type return.

However, many developers found that unsatisfactory, and various alternative solutions were developed in various Markdown parsers. One of those is the backslash at the end of a line, as described in CommonMark, which was later adapted into GitHub Flavored Markdown.

That behavior is by no means universal, however. Redcarpet, the Markdown parser used by Ares, has a hard_wrap option that makes it actually parse line breaks as you see them, so that:

one line
another line

Actually renders as:

one line<br>
another line

This way is most compatible with text entered on a MU client, IMHO, which is why it’s the one Ares uses.

But why are we concerned about text entered on the MU client? That brings us to the second angle…

Markdown in Ares

Generally speaking, there’s no such thing in Ares as “text intended for the portal”. Everything goes into a common back-end and database, and is designed so that it can be entered or rendered on either a MU client or the portal.

For example, relationships are typically more of a portal thing, but they can also be viewed and managed from a MU client with the relationships command. Descriptions, backgrounds, forum posts, mail messages, jobs, etc., etc., … the overwhelming majority of text can be viewed and edited in both places, so that is the foundation of the architecture.

It’s true that there are a few things that you currently can’t view from a MU client (for instance, wiki pages and extended profile fields), but that is due to either laziness or philosophical choices, not a technical limitation. The game engine is designed to be common to both interfaces.

2 Likes