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
abiutg-spoilerstrikesh1h2blockquoteulollicodepre
Please note:
- The
h1andh2tags are used for headings. In most social networks, their rendering may differ or be converted to bold text. - The
strikeandstags are equivalent — both create strikethrough text. - The
tg-spoilertag hides text behind a spoiler in Telegram and is revealed when the user taps it. - The
codeandpretags are intended for code.codeis for short inline fragments,preis 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.