Wrap the text in Markdown Header with HTML underline tag
Use Markdown Bold tag along with HTML underline tag
Expected result
The Header should be rendered as an Header (Bold and in large text)
When using underline in conjunction with bold tag the output should show both the underline and bold style on the text
Actual result
The header looses its bold styling and text size becomes small
When underline tag is present inside the bold tag only underline is rendered while when underline is outside the bold tag the only the bold styling is rendered
Environment
Operating system: Windows 11 build 22000.438 (64-bit)
Debug info:
SYSTEM INFO:
Obsidian version: v0.13.19
Installer version: v0.13.19
Login status: not logged in
Insider build toggle: off
Live preview: on
Legacy editor: off
Base theme: dark
Community theme: none
Snippets enabled: 13
Safe mode: off
Plugins installed: 9
Plugins enabled: 0
Additional information
All the snippets, plugins and custom themes have been disabled before testing
The 1st line shows heading in live preview mode when underline is used
The 2nd line shows the same issue when there cursor is actively editing the line
FWIW, I’ve just discovered that using span tags with the appropriate CSS — span style="text-decoration: underline;" — produces the same results as in the initial description.
I would like to have underline shortcut in markdown just like bold and italic. Ctrl+l would be nice. right now i am using “<ins> text </ins>”. Not convenient as you can see.
Markdown does not have a syntax for underlines. (This could be because the “right” usage of underlines in a print document, aside from hyperlinks, are obscure and uncommon. That is an educated guess.)
I work around this by using Markdown’s == syntax for marking passages in text. At the start of the passage I use == as per normal. At the end of the passage I use ===, which is not correct but serves my purposes. == represents <ins> and === represents </ins>; I flip back and forth between them using find and replace as I prefer in the moment.
A smarter, less flexible solution would be to edit your custom CSS so that <mark> elements are underlined with colorless background rather than highlighted.
In obsidian, we can already use bold text, italics, and strikethrough, but there is no command for underlining. Luckily HTML commands are enabled and we can underline text with the command <u> text </u>.
I propose a simple command like ctrl/cmd + U for toggling underline text and introduce the HTML command shown above.
@Cedric I would use something like AutoHotkey to create the hotkey. It would trigger the following procedure: copy the selected text, add surrounding html tags, paste modified text back into editor.
This AutoHotkey script would work in any editor, not only in Obsidian.