HomeAboutPostsTagsProjectsRSS

markdown

Updated
Words65
TagsRead1 minute

Posting a markdown document directly to Telegram will display formatting like code blocks and bold text in the message. However, the content received by the Telegram bot differs from what is initially sent, particularly with the removal of backticks.

To send the message content as plain text without formatting, I first paste it into Apple Note on iOS and then share it with the Telegram bot.

Updated
Words169
TagsRead1 minute

A nice way to add arbitrary HTML tags in Hugo site markdown content.

Create a content.html in layouts/partials

{{
.
| replaceRE `\{\^([^}]*)\}` "<sup>$1</sup>"
| replaceRE `\{\_([^}]*)\}` "<sub>$1</sub>"
| replaceRE `\{\#([^}]*)\}` "<kbd>$1</kbd>"
| replaceRE `\{\!([^}]*)\}` "<mark>$1</mark>"
| replaceRE `\{\=([^}]*)\}` "<cite>$1</cite>"
| replaceRE `\{\+([^}]*)\}` "<ins>$1</ins>"
| replaceRE `\{\$([^}]*)\}` "<var>$1</var>"
| safeHTML 
}}

and use the partial html template {{ partial "content.html" .Content }} to render the HTML

Get missing inline HTML tags in Markdown without enabling HTML - tips & tricks - HUGO