Markdown best practices for writing '*' symbol

In HTML, tags like are used for italics, bold, bold italics, and so on. They are clumsy to write by hand, so Markdown introduces the option of simply using asterisks instead. This is understandable. You can still write an asterisk* or even an * without undesirable effects, which is a creative solution since you cannot bold or italicise whitespace in real life either! But if you try to prepend an * to a word, at its beginning, everything following will be affected. With or without a closing asterisk.

But because it is a rule with Markdown, at least three scientific disciplines will be negatively affected.

(1) Textual scholarship. The * is used by convention to transcribe lost/illegible text, as well as to transcribe instances of the character * as it evolved over time from the manuscript era to the print era and beyond. Both transcribing and writing modern literature may require heavy use of asterisks and asterisk sequences in the censoring of expletives. Sometimes the \ workaround is acceptable. But it is not uncommon for a text to consist mostly of ************************, with characters in between in such a way that would make applying backslashes as tedious as the work Markdown ordinarily saves.

(2) Mathematics. Enough mathematicians are using Markdown based note taking programs these days that I have the greatest hope from users in this community for finding a convenient solution to this known problem. Or perhaps someone in the applied sciences likes to keep notes about file searching? Some can afford to replace all instances with a substitute. Others cannot.

(3) Linguistics. Especially reconstructive linguistics, where using asterisks to denote reconstructions *word and tentative reconstructions **word often results in there being more asterisks that need to remain visible than asterisks used to make text italic and bold. Since Markdown was not designed with linguists in mind, the extra character burden can be a prohibitive barrier for disciplines like this.

Not at all meaning to sound rude. I know Markdown was not designed with the scientific disciplines whose notes traditionally incorporate some of its core markup symbols in mind. But when a group of programmers get together and build something as attractive as this in mind (:heart:), it is bound to attract some of us.

So if someone here has figured out a more convenient way within Obsidian to enter characters like this so that they will not be treated as Markdown, can you please let me know in below? A keyboard shortcut perhaps? I am thinking of creating a separate keyboard layout just for use within Obsidian. Which in the era of Unicode is probably the way I would have designed a lightweight markup language.

+1 to anyone who can figure out how to write the sequence backslash-backslash-asterisk in such a way that all three appear consecutively.

  • 2 if you can figure out the sequence asterisk-backslash-asterisk.

P.S. I know Markdown is rather central to Obsidian, but is there a good reason why one cannot simply “Toggle Markdown”,?

1 Like

I suggest marking specialized text like that as code — it’s bending the semantics a little, but I think not too badly.

Inline: `************************`

Block:

```
************************
```

If the resulting appearance is a problem, you can change it with a CSS snippet (and you can add a class in the YAML metadata of a note if you only want to change the appearance of code in some notes).

To type either of the bonus sequences you asked about, just type a backslash before each character (including the backslashes that you want to appear).

  • \\\\\* = \\*
  • \*\\\* = *\*

Because it’s rather central to Obsidian. :stuck_out_tongue:

There are a few plugins that let you work with plain, non-Markdown text. At least some of them come with limitations that might make them unsuitable.

3 Likes

Ah, thank you!

So there is a way for * to be treated as text within a given document, using CSS?

  • CawlinTeffid was referring to the first option (putting the asterisk inside a inline code i.e. `*` in editing/live preview becomes * when in reading view.
    • If you feel the formatting of the resultant (which is * with the background and monospace font) not desirable, that part you can change using CSS.
    • But as CawlinTeffid noted, that’s sort of using a workaround that’s not design for it – you will find your other inline code formatting would also change
  • CSS cannot affect how certain markdown formatting tags be interpreted into HTML – CSS can only affect after that’s done.
    • in your case, the *italics* would have been converted to <em>italics</em> and CSS cannot bring back the asterisk (*)
  • the escaping (with backslash \) method is normally the suggested approach
    • rendered text: *normal text* bold text
    • raw markdown: \*normal text\* **bold text**
3 Likes

I doubt there exists a perfect solution to your request. I’d suggest that you do a feature request for ```txt
That would treat the following the same as a code block but for txt

There are other approaches, but their value depends on how you use Obsidian and how much of Obsidian’s markdown formatting is useful to you. And on how you integrate Obsidian with use of other programs.

2 Likes

Keyboards type—and Markdown uses—superscript asterisks (U+002A).

If you use a standard asterisk (U+2217), it will appear as an asterisk and won’t be parsed as Markdown formatting.

In macOS I have this as a shortcut where .a. is replaced as while typing.

4 Likes

Thank you! All the advice has been much appreciated, but this solution allows me to easily reconvert ∗ to * with a simple search-and-replace.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.