diff options
author | silverwind <me@silverwind.io> | 2023-05-20 23:02:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-20 23:02:52 +0200 |
commit | 32d9c47ec7706d8f06e09b42e09a28d7a0e3c526 (patch) | |
tree | 36eeecea9af4a8200c2d8b49e835c88be60cbf2e /modules/markup/html.go | |
parent | 1698c15cba8f9eedfcb6af8226f3e97950480aca (diff) | |
download | gitea-32d9c47ec7706d8f06e09b42e09a28d7a0e3c526.tar.gz gitea-32d9c47ec7706d8f06e09b42e09a28d7a0e3c526.zip |
Add RTL rendering support to Markdown (#24816)
Support RTL content in Markdown:
![image](https://github.com/go-gitea/gitea/assets/115237/dedb1b0c-2f05-40dc-931a-0d9dc81f7c97)
Example document:
https://try.gitea.io/silverwind/symlink-test/src/branch/master/bidi-text.md
Same on GitHub:
https://github.com/silverwind/symlink-test/blob/master/bidi-text.md
`dir=auto` enables a browser heuristic that sets the text direction
automatically. It is the only way to get automatic text direction.
Ref: https://codeberg.org/Codeberg/Community/issues/1021
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'modules/markup/html.go')
-rw-r--r-- | modules/markup/html.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/markup/html.go b/modules/markup/html.go index 11888b8536..da16bcd3cb 100644 --- a/modules/markup/html.go +++ b/modules/markup/html.go @@ -630,7 +630,7 @@ func mentionProcessor(ctx *RenderContext, node *html.Node) { } mentionedUsername := mention[1:] - if processorHelper.IsUsernameMentionable != nil && processorHelper.IsUsernameMentionable(ctx.Ctx, mentionedUsername) { + if DefaultProcessorHelper.IsUsernameMentionable != nil && DefaultProcessorHelper.IsUsernameMentionable(ctx.Ctx, mentionedUsername) { replaceContent(node, loc.Start, loc.End, createLink(util.URLJoin(setting.AppURL, mentionedUsername), mention, "mention")) node = node.NextSibling.NextSibling } else { |