Markdown compatibility (with concrete example)

What’s The Bug?

Please improve markdown compatibility of the editor. The concrete example I have in mind is this: Test for something (_really!!_) imporant. Feel free to not stop there if you find other issues :wink:

My reference is GitHub markdown, see screenshots.

How To Reproduce It

  1. open a page
  2. write test (_really!!_)
  3. see the wrong result

See video.

Image or Video



The Expected Behavior

See video and images.

Device

Mac Mini 2024

OS

Sequoia 15.5 (24F74)

Anytype Version

0.46.5

Network Mode

AnySync

Technical Information

OS version: darwin arm64 15.5.0
App version: 0.46.5
Build number: build on 2025-05-09 13:56:27 +0000 UTC at #d0dff8b9a774bb25e57dc6aaf3e8cf0903351d69
Library version: v0.40.21
Anytype Identity: ABRAoHEP1impMW3DyMRAbELnYjV5M27h5JRecNB3KPGi6vLr
Analytics ID: A8MkhLywF2qZjmjdF7NF8GwFa2shiGNZAynUfxNWv6uH5J78
Device ID: 12D3KooWQ333dNmGYeFXPeSw6NrMFLb11fnTCphnWmh5R9xfaNCR
Ethereum Address: 0xFC3226BD51F6D415e9Dff876006459861E4c5fD9

I don’t think it’s a bug (and modifying could cause other unwanted markdown problems).
Markdown doesn’t accept bold or italic caracter inside a word.
It sometimes works, but in many applications it’s also refused.
With a space to mark the beginning of the word, it works very well.

Italic Best Practices

Markdown applications don’t agree on how to handle underscores in the middle of a word. For compatibility, use asterisks to italicize the middle of a word for emphasis.
Basic Syntax | Markdown Guide

Many implementations have also restricted intraword emphasis to the * forms, to avoid unwanted emphasis in words containing internal underscores. (It is best practice to put these in code spans, but users often do not.)
CommonMark Spec

Well, define “inside a word” … in no definition I am aware of either one of [!()] are part of “word characters”. Also while GitHub might have more resources than Any, it’s a pretty straightforward implementation of Markdown.

Also the spec you just linked has a similar example to mine: “Italicized text is the _cat's meow_.” The only difference to mine is the opening parenthesis, which should behave similar on first impulse.

So I would say I’m very well within the confounds of the defined :wink: areas of the spec.

For information, the regex as defined in the Anytype code considers the beginning of a markdown string as having to start with a space (or be at the beginning of a line) :wink:.
Not complicated to modify, I can always propose a correction (but I’m always afraid of working for nothing if it affects an internal decision).

Merged, thanks

I start wondering what “Bug Detectives” actually are, if you apparently can make corrections in the source … or did I get this wrong? :thinking:

so … does that mean that correction was made and it’s fixed now? wohoo! (thanks @Shampra, i guess :slight_smile:)

so while we’re on the subject of markdown, i’d like to redirect attention again to “whitespace behavior” … :grimacing:

We’re just here to help out on the forum (basic: tag bug tickets or FRs, and more if affinity ^^).
But the source code is open and anyone can participate (with quite a few limitations, unfortunately). So if I can help with debugging AND fixing, that’s one problem less :).

:blush:

:sweat_smile:
Helping out requires a lot of free time (and inevitably, I’m less efficient than the team on their code). And of course it’s very dependent on my motivation, which, as I’ve already mentioned, is currently in serious decline. I’ll save the post for later :wink:

aaaaah let’s not go there please :laughing:been there, won’t change my mind :wink:

… and this should not be your responsibility. that was, in fact, directed rather more at @Razor … . sorry if that was unclear :slight_smile: