How to handle special characters in rst files?

apurv kulkarni October 10, 2024

Suppose I want to use <,>, &£@,, etc but I wants to add as it is in rst, not unicode &amp like this.

 

Ex, data: 12 > 6 in number like this I wants to add

 

1 answer

0 votes
Humashankar VJ
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 12, 2024

Hi @apurv kulkarni

When working with reStructuredText (RST) files and you want to include special characters like <, >, &, £, @, etc. without them being interpreted as markup, you have a few options:

  1. Use backslashes to escape special characters: You can precede special characters with a backslash ($$ to treat them as literal characters:
  • 12 \> 6 in number
  1. Enclose text in double backticks:For inline content, use double backticks to create a literal text span:
  • 12 > 6 in number``
  1. Use the "raw" directive:For larger blocks of text, you can use the "raw" directive:
  • .. raw:: html
  • 12 > 6 in number
  1. Use a code block: If you're representing code or want to preserve formatting, use a code block:
  • code-block
  • 12 > 6 in number
  1. Use Unicode character names: For some special characters, you can use their Unicode character names:
  • 12 |gt| 6 in number

Refer the article for more help - Confluence issues with special characters used in content name when behind a proxy | Confluence | Atlassian Documentation

Hope this helps - Happy to help further!!
Thank you very much and have a great one!
Warm regards

 

 

apurv kulkarni October 12, 2024

It will work for data centre confluence? Or we need to enable any configuration?

Like Humashankar VJ likes this
Humashankar VJ
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 13, 2024

Hi @apurv kulkarni 

Handling special characters in (RST) files for Confluence can be challenging, particularly in Data Center installations. Fortunately, RST supports Unicode characters, allowing direct use of special characters like em dashes (—) and en dashes (–)

Though, Confluence has specific considerations. Avoiding special characters in page titles and attachment names is recommended, as they may cause search and functionality issues, especially when behind a proxy.

Furthermore, special characters in URLs may be encoded differently, leading to linking problems between applications like JIRA and Confluence.

 Confluence Data Center lacks native support for RST files and doesn't have a built-in macro or conversion tool.

To overcome this limitation, consider options like the Sphinx Confluence Builder, a third-party tool publishing Sphinx documentation (using RST) to Confluence. Instead, using a Markdown flavor compatible with both RST and Confluence can provide a suitable middle ground.

Best Regards

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events