Skip to main content

Which HTML tags are supported in publications?

In the text of posts, captions, and media descriptions, a limited set of HTML tags is supported for basic formatting.

The following tags

  • a
  • b
  • i
  • u
  • tg-spoiler
  • strike
  • s
  • h1
  • h2
  • blockquote
  • ul
  • ol
  • li
  • code
  • pre

Please note:

  • The h1 and h2 tags are used for headings. In most social networks, their rendering may differ or be converted to bold text.
  • The strike and s tags are equivalent — both create strikethrough text.
  • The tg-spoiler tag hides text behind a spoiler in Telegram and is revealed when the user taps it.
  • The code and pre tags are intended for code. code is for short inline fragments, pre is for multi‑line blocks that preserve spaces and line breaks.
  • All other HTML tags not listed above are automatically removed for security and compatibility reasons.

Examples

Clickable link:

<a href="https://postmypost.io">Go to website</a>

Text emphasis:

<b>Important text</b>, <i>italic</i>, <u>underlined</u>, <s>strikethrough</s>

Headings and quote:

<h1>Heading H1</h1>
<h2>Heading H2</h2>
<blockquote>A quote or highlighted paragraph</blockquote>

Lists:

<ul>
<li>Unordered list item</li>
<li>Another item</li>
</ul>

<ol>
<li>First item</li>
<li>Second item</li>
</ol>

Code:

Inline fragment: <code>npm run build</code>

Multi‑line code block:

<pre>
function hello() {
console.log('Hello, world!');
}
</pre>

Spoiler (Telegram):

<tg-spoiler>Secret text that will be revealed on tap</tg-spoiler>

Tips

  • Check preview before publishing: different social networks may render HTML formatting differently.
  • Avoid nesting unsupported tags inside supported ones — such HTML will be sanitized.