Underscores between words are being removed

What I did: typed: word1_word2_word3

What happened: the underscore was removed and ‘word2’ was italisized

What I expected: wysiwyg.

I tried setting the style to preformatted , and using markdown syntax ‘’’ and blocks. but it still removed the underscores and italisized the enclosed word.

Things that might be helpful to know (Agenda version, OS and model, etc):

Indeed the underscores are interpreted as the markdown command for italic, and removed after applying the format. The workaround is to apply the fixed width inline style, which has a shortcut as well, simply enclose the word that has the underscores in backpacks, like this:

`word1_word2_word3`

which will then show up as word1_word2_word3 and prevent the removal of the underscores.

2 Likes

Just wanted to express that I encounter this frequently because my notes often include code snippets and references to function and variable names. It’s particularly annoying to deal with since I cannot paste a chuck of text as “Preformatted” and so have to go back and set the style and then re-add the removed underscores.

Could your text processor detect the italicized text and insert the underscores when a selection of text is set to the “Preformatted” style?

Could your text processor detect the italicized text and insert the underscores when a selection of text is set to the “Preformatted” style?

I believe this is how it should work indeed. We did make some fixes in today’s 1.4 update, can you confirm whether it’s still an issue even after the update?

Yes, it’s still an issue after updating to 1.4 (App Store). Here’s an imgur video showing that the italics are still present after I select the text and apply the “Preformatted” style using the control+command+5 shortcut.

Ah, I see. I think our lines are crossed. In the video, once you paste, the damage has been done. Ie the text is already changed to italic, and the underscores are gone.

The trick is to setup the preformatted paragraph before you paste into it. That way the underscores will be ignored.

So you put the cursor where you want to paste, you choose the Preformatted style, and then you paste.

Let me know if it still has issues, but it should not.

Yes. If I click the line, use the control+command+5 shortcut, and then paste the code; then I get fixed width font with perserved underscores.
I just need to add that step to my workflow.

1 Like

Yes, but _ inside words almost never mean italics, preformatted or not. Inter-word emphasis in most flavours of Markdown is limited to the * delimiter. This is made explicit in the Github-flavoured Markdown variant spec GitHub Flavored Markdown Spec

1 Like

I will look to make it less tolerant, but it doesn’t solve the problem anyway. There will always be cases where an underscore could be misinterpreted, so we can make it better, but rules like “must neighbor a space” only half solves the issue.

Thanks for fixing this. This is fast becoming one of my favorite apps, :grinning:

1 Like