Skip to content

Commit f910988

Browse files
committed
fix tests
1 parent b6e9b75 commit f910988

File tree

6 files changed

+77
-68
lines changed

6 files changed

+77
-68
lines changed

modules/markup/html.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ func mentionProcessor(ctx *RenderContext, node *html.Node) {
630630
}
631631
mentionedUsername := mention[1:]
632632

633-
if processorHelper.IsUsernameMentionable != nil && processorHelper.IsUsernameMentionable(ctx.Ctx, mentionedUsername) {
633+
if DefaultProcessorHelper.IsUsernameMentionable != nil && DefaultProcessorHelper.IsUsernameMentionable(ctx.Ctx, mentionedUsername) {
634634
replaceContent(node, loc.Start, loc.End, createLink(util.URLJoin(setting.AppURL, mentionedUsername), mention, "mention"))
635635
node = node.NextSibling.NextSibling
636636
} else {

modules/markup/markdown/goldmark.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ func (g *ASTTransformer) Transform(node *ast.Document, reader text.Reader, pc pa
4747
tocMode = rc.TOC
4848
}
4949

50+
applyElementDir := func(n ast.Node) {
51+
if markup.DefaultProcessorHelper.ElementDir != "" {
52+
n.SetAttributeString("dir", []byte(markup.DefaultProcessorHelper.ElementDir))
53+
}
54+
}
55+
5056
attentionMarkedBlockquotes := make(container.Set[*ast.Blockquote])
5157
_ = ast.Walk(node, func(n ast.Node, entering bool) (ast.WalkStatus, error) {
5258
if !entering {
@@ -69,9 +75,9 @@ func (g *ASTTransformer) Transform(node *ast.Document, reader text.Reader, pc pa
6975
header.ID = util.BytesToReadOnlyString(id.([]byte))
7076
}
7177
tocList = append(tocList, header)
72-
v.SetAttributeString("dir", []byte("auto"))
78+
applyElementDir(v)
7379
case *ast.Paragraph:
74-
v.SetAttributeString("dir", []byte("auto"))
80+
applyElementDir(v)
7581
case *ast.Image:
7682
// Images need two things:
7783
//
@@ -174,7 +180,7 @@ func (g *ASTTransformer) Transform(node *ast.Document, reader text.Reader, pc pa
174180
v.AppendChild(v, newChild)
175181
}
176182
}
177-
v.SetAttributeString("dir", []byte("auto"))
183+
applyElementDir(v)
178184
case *ast.Text:
179185
if v.SoftLineBreak() && !v.HardLineBreak() {
180186
renderMetas := pc.Get(renderMetasKey).(map[string]string)

modules/markup/markdown/markdown_test.go

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ func TestRender_StandardLinks(t *testing.T) {
6868
assert.Equal(t, strings.TrimSpace(expectedWiki), strings.TrimSpace(buffer))
6969
}
7070

71-
googleRendered := `<p dir="auto"><a href="https://google.com/" rel="nofollow">https://google.com/</a></p>`
71+
googleRendered := `<p><a href="https://google.com/" rel="nofollow">https://google.com/</a></p>`
7272
test("<https://google.com/>", googleRendered, googleRendered)
7373

7474
lnk := util.URLJoin(AppSubURL, "WikiPage")
7575
lnkWiki := util.URLJoin(AppSubURL, "wiki", "WikiPage")
7676
test("[WikiPage](WikiPage)",
77-
`<p dir="auto"><a href="`+lnk+`" rel="nofollow">WikiPage</a></p>`,
78-
`<p dir="auto"><a href="`+lnkWiki+`" rel="nofollow">WikiPage</a></p>`)
77+
`<p><a href="`+lnk+`" rel="nofollow">WikiPage</a></p>`,
78+
`<p><a href="`+lnkWiki+`" rel="nofollow">WikiPage</a></p>`)
7979
}
8080

8181
func TestRender_Images(t *testing.T) {
@@ -99,49 +99,49 @@ func TestRender_Images(t *testing.T) {
9999

100100
test(
101101
"!["+title+"]("+url+")",
102-
`<p dir="auto"><a href="`+result+`" target="_blank" rel="nofollow noopener"><img src="`+result+`" alt="`+title+`"/></a></p>`)
102+
`<p><a href="`+result+`" target="_blank" rel="nofollow noopener"><img src="`+result+`" alt="`+title+`"/></a></p>`)
103103

104104
test(
105105
"[["+title+"|"+url+"]]",
106-
`<p dir="auto"><a href="`+result+`" rel="nofollow"><img src="`+result+`" title="`+title+`" alt="`+title+`"/></a></p>`)
106+
`<p><a href="`+result+`" rel="nofollow"><img src="`+result+`" title="`+title+`" alt="`+title+`"/></a></p>`)
107107
test(
108108
"[!["+title+"]("+url+")]("+href+")",
109-
`<p dir="auto"><a href="`+href+`" rel="nofollow"><img src="`+result+`" alt="`+title+`"/></a></p>`)
109+
`<p><a href="`+href+`" rel="nofollow"><img src="`+result+`" alt="`+title+`"/></a></p>`)
110110

111111
url = "/../../.images/src/02/train.jpg"
112112
test(
113113
"!["+title+"]("+url+")",
114-
`<p dir="auto"><a href="`+result+`" target="_blank" rel="nofollow noopener"><img src="`+result+`" alt="`+title+`"/></a></p>`)
114+
`<p><a href="`+result+`" target="_blank" rel="nofollow noopener"><img src="`+result+`" alt="`+title+`"/></a></p>`)
115115

116116
test(
117117
"[["+title+"|"+url+"]]",
118-
`<p dir="auto"><a href="`+result+`" rel="nofollow"><img src="`+result+`" title="`+title+`" alt="`+title+`"/></a></p>`)
118+
`<p><a href="`+result+`" rel="nofollow"><img src="`+result+`" title="`+title+`" alt="`+title+`"/></a></p>`)
119119
test(
120120
"[!["+title+"]("+url+")]("+href+")",
121-
`<p dir="auto"><a href="`+href+`" rel="nofollow"><img src="`+result+`" alt="`+title+`"/></a></p>`)
121+
`<p><a href="`+href+`" rel="nofollow"><img src="`+result+`" alt="`+title+`"/></a></p>`)
122122
}
123123

124124
func testAnswers(baseURLContent, baseURLImages string) []string {
125125
return []string{
126-
`<p dir="auto">Wiki! Enjoy :)</p>
127-
<ul dir="auto">
126+
`<p>Wiki! Enjoy :)</p>
127+
<ul>
128128
<li><a href="` + baseURLContent + `/Links" rel="nofollow">Links, Language bindings, Engine bindings</a></li>
129129
<li><a href="` + baseURLContent + `/Tips" rel="nofollow">Tips</a></li>
130130
</ul>
131-
<p dir="auto">See commit <a href="http://localhost:3000/gogits/gogs/commit/65f1bf27bc" rel="nofollow"><code>65f1bf27bc</code></a></p>
132-
<p dir="auto">Ideas and codes</p>
133-
<ul dir="auto">
131+
<p>See commit <a href="http://localhost:3000/gogits/gogs/commit/65f1bf27bc" rel="nofollow"><code>65f1bf27bc</code></a></p>
132+
<p>Ideas and codes</p>
133+
<ul>
134134
<li>Bezier widget (by <a href="` + AppURL + `r-lyeh" rel="nofollow">@r-lyeh</a>) <a href="http://localhost:3000/ocornut/imgui/issues/786" class="ref-issue" rel="nofollow">ocornut/imgui#786</a></li>
135135
<li>Bezier widget (by <a href="` + AppURL + `r-lyeh" rel="nofollow">@r-lyeh</a>) <a href="http://localhost:3000/gogits/gogs/issues/786" class="ref-issue" rel="nofollow">#786</a></li>
136136
<li>Node graph editors <a href="https://github.com/ocornut/imgui/issues/306" rel="nofollow">https://github.com/ocornut/imgui/issues/306</a></li>
137137
<li><a href="` + baseURLContent + `/memory_editor_example" rel="nofollow">Memory Editor</a></li>
138138
<li><a href="` + baseURLContent + `/plot_var_example" rel="nofollow">Plot var helper</a></li>
139139
</ul>
140140
`,
141-
`<h2 id="user-content-what-is-wine-staging" dir="auto">What is Wine Staging?</h2>
142-
<p dir="auto"><strong>Wine Staging</strong> on website <a href="http://wine-staging.com" rel="nofollow">wine-staging.com</a>.</p>
143-
<h2 id="user-content-quick-links" dir="auto">Quick Links</h2>
144-
<p dir="auto">Here are some links to the most important topics. You can find the full list of pages at the sidebar.</p>
141+
`<h2 id="user-content-what-is-wine-staging">What is Wine Staging?</h2>
142+
<p><strong>Wine Staging</strong> on website <a href="http://wine-staging.com" rel="nofollow">wine-staging.com</a>.</p>
143+
<h2 id="user-content-quick-links">Quick Links</h2>
144+
<p>Here are some links to the most important topics. You can find the full list of pages at the sidebar.</p>
145145
<table>
146146
<thead>
147147
<tr>
@@ -157,50 +157,50 @@ func testAnswers(baseURLContent, baseURLImages string) []string {
157157
</tbody>
158158
</table>
159159
`,
160-
`<p dir="auto"><a href="http://www.excelsiorjet.com/" rel="nofollow">Excelsior JET</a> allows you to create native executables for Windows, Linux and Mac OS X.</p>
161-
<ol dir="auto">
160+
`<p><a href="http://www.excelsiorjet.com/" rel="nofollow">Excelsior JET</a> allows you to create native executables for Windows, Linux and Mac OS X.</p>
161+
<ol>
162162
<li><a href="https://github.com/libgdx/libgdx/wiki/Gradle-on-the-Commandline#packaging-for-the-desktop" rel="nofollow">Package your libGDX application</a><br/>
163163
<a href="` + baseURLImages + `/images/1.png" rel="nofollow"><img src="` + baseURLImages + `/images/1.png" title="1.png" alt="images/1.png"/></a></li>
164164
<li>Perform a test run by hitting the Run! button.<br/>
165165
<a href="` + baseURLImages + `/images/2.png" rel="nofollow"><img src="` + baseURLImages + `/images/2.png" title="2.png" alt="images/2.png"/></a></li>
166166
</ol>
167-
<h2 id="user-content-custom-id" dir="auto">More tests</h2>
168-
<p dir="auto">(from <a href="https://www.markdownguide.org/extended-syntax/" rel="nofollow">https://www.markdownguide.org/extended-syntax/</a>)</p>
169-
<h3 id="user-content-checkboxes" dir="auto">Checkboxes</h3>
170-
<ul dir="auto">
167+
<h2 id="user-content-custom-id">More tests</h2>
168+
<p>(from <a href="https://www.markdownguide.org/extended-syntax/" rel="nofollow">https://www.markdownguide.org/extended-syntax/</a>)</p>
169+
<h3 id="user-content-checkboxes">Checkboxes</h3>
170+
<ul>
171171
<li class="task-list-item"><input type="checkbox" disabled="" data-source-position="434"/>unchecked</li>
172172
<li class="task-list-item"><input type="checkbox" disabled="" data-source-position="450" checked=""/>checked</li>
173173
<li class="task-list-item"><input type="checkbox" disabled="" data-source-position="464"/>still unchecked</li>
174174
</ul>
175-
<h3 id="user-content-definition-list" dir="auto">Definition list</h3>
175+
<h3 id="user-content-definition-list">Definition list</h3>
176176
<dl>
177177
<dt>First Term</dt>
178178
<dd>This is the definition of the first term.</dd>
179179
<dt>Second Term</dt>
180180
<dd>This is one definition of the second term.</dd>
181181
<dd>This is another definition of the second term.</dd>
182182
</dl>
183-
<h3 id="user-content-footnotes" dir="auto">Footnotes</h3>
184-
<p dir="auto">Here is a simple footnote,<sup id="fnref:user-content-1"><a href="#fn:user-content-1" rel="nofollow">1</a></sup> and here is a longer one.<sup id="fnref:user-content-bignote"><a href="#fn:user-content-bignote" rel="nofollow">2</a></sup></p>
183+
<h3 id="user-content-footnotes">Footnotes</h3>
184+
<p>Here is a simple footnote,<sup id="fnref:user-content-1"><a href="#fn:user-content-1" rel="nofollow">1</a></sup> and here is a longer one.<sup id="fnref:user-content-bignote"><a href="#fn:user-content-bignote" rel="nofollow">2</a></sup></p>
185185
<div>
186186
<hr/>
187-
<ol dir="auto">
187+
<ol>
188188
<li id="fn:user-content-1">
189-
<p dir="auto">This is the first footnote. <a href="#fnref:user-content-1" rel="nofollow">↩︎</a></p>
189+
<p>This is the first footnote. <a href="#fnref:user-content-1" rel="nofollow">↩︎</a></p>
190190
</li>
191191
<li id="fn:user-content-bignote">
192-
<p dir="auto">Here is one with multiple paragraphs and code.</p>
193-
<p dir="auto">Indent paragraphs to include them in the footnote.</p>
194-
<p dir="auto"><code>{ my code }</code></p>
195-
<p dir="auto">Add as many paragraphs as you like. <a href="#fnref:user-content-bignote" rel="nofollow">↩︎</a></p>
192+
<p>Here is one with multiple paragraphs and code.</p>
193+
<p>Indent paragraphs to include them in the footnote.</p>
194+
<p><code>{ my code }</code></p>
195+
<p>Add as many paragraphs as you like. <a href="#fnref:user-content-bignote" rel="nofollow">↩︎</a></p>
196196
</li>
197197
</ol>
198198
</div>
199-
`, `<ul dir="auto">
199+
`, `<ul>
200200
<li class="task-list-item"><input type="checkbox" disabled="" data-source-position="3"/> If you want to rebase/retry this PR, click this checkbox.</li>
201201
</ul>
202202
<hr/>
203-
<p dir="auto">This PR has been generated by <a href="https://github.com/renovatebot/renovate" rel="nofollow">Renovate Bot</a>.</p>
203+
<p>This PR has been generated by <a href="https://github.com/renovatebot/renovate" rel="nofollow">Renovate Bot</a>.</p>
204204
`,
205205
}
206206
}
@@ -304,12 +304,12 @@ func TestTotal_RenderWiki(t *testing.T) {
304304
// Guard wiki sidebar: special syntax
305305
`[[Guardfile-DSL / Configuring-Guard|Guardfile-DSL---Configuring-Guard]]`,
306306
// rendered
307-
`<p dir="auto"><a href="` + AppSubURL + `wiki/Guardfile-DSL---Configuring-Guard" rel="nofollow">Guardfile-DSL / Configuring-Guard</a></p>
307+
`<p><a href="` + AppSubURL + `wiki/Guardfile-DSL---Configuring-Guard" rel="nofollow">Guardfile-DSL / Configuring-Guard</a></p>
308308
`,
309309
// special syntax
310310
`[[Name|Link]]`,
311311
// rendered
312-
`<p dir="auto"><a href="` + AppSubURL + `wiki/Link" rel="nofollow">Name</a></p>
312+
`<p><a href="` + AppSubURL + `wiki/Link" rel="nofollow">Name</a></p>
313313
`,
314314
}
315315

@@ -401,7 +401,7 @@ func TestRenderSiblingImages_Issue12925(t *testing.T) {
401401
testcase := `![image1](/image1)
402402
![image2](/image2)
403403
`
404-
expected := `<p dir="auto"><a href="/image1" target="_blank" rel="nofollow noopener"><img src="/image1" alt="image1"></a><br>
404+
expected := `<p><a href="/image1" target="_blank" rel="nofollow noopener"><img src="/image1" alt="image1"></a><br>
405405
<a href="/image2" target="_blank" rel="nofollow noopener"><img src="/image2" alt="image2"></a></p>
406406
`
407407
res, err := RenderRawString(&markup.RenderContext{Ctx: git.DefaultContext}, testcase)
@@ -411,7 +411,7 @@ func TestRenderSiblingImages_Issue12925(t *testing.T) {
411411

412412
func TestRenderEmojiInLinks_Issue12331(t *testing.T) {
413413
testcase := `[Link with emoji :moon: in text](https://gitea.io)`
414-
expected := `<p dir="auto"><a href="https://gitea.io" rel="nofollow">Link with emoji <span class="emoji" aria-label="waxing gibbous moon">🌔</span> in text</a></p>
414+
expected := `<p><a href="https://gitea.io" rel="nofollow">Link with emoji <span class="emoji" aria-label="waxing gibbous moon">🌔</span> in text</a></p>
415415
`
416416
res, err := RenderString(&markup.RenderContext{Ctx: git.DefaultContext}, testcase)
417417
assert.NoError(t, err)
@@ -426,23 +426,23 @@ func TestColorPreview(t *testing.T) {
426426
}{
427427
{ // hex
428428
"`#FF0000`",
429-
`<p dir="auto"><code>#FF0000<span class="color-preview" style="background-color: #FF0000"></span></code></p>` + nl,
429+
`<p><code>#FF0000<span class="color-preview" style="background-color: #FF0000"></span></code></p>` + nl,
430430
},
431431
{ // rgb
432432
"`rgb(16, 32, 64)`",
433-
`<p dir="auto"><code>rgb(16, 32, 64)<span class="color-preview" style="background-color: rgb(16, 32, 64)"></span></code></p>` + nl,
433+
`<p><code>rgb(16, 32, 64)<span class="color-preview" style="background-color: rgb(16, 32, 64)"></span></code></p>` + nl,
434434
},
435435
{ // short hex
436436
"This is the color white `#000`",
437-
`<p dir="auto">This is the color white <code>#000<span class="color-preview" style="background-color: #000"></span></code></p>` + nl,
437+
`<p>This is the color white <code>#000<span class="color-preview" style="background-color: #000"></span></code></p>` + nl,
438438
},
439439
{ // hsl
440440
"HSL stands for hue, saturation, and lightness. An example: `hsl(0, 100%, 50%)`.",
441-
`<p dir="auto">HSL stands for hue, saturation, and lightness. An example: <code>hsl(0, 100%, 50%)<span class="color-preview" style="background-color: hsl(0, 100%, 50%)"></span></code>.</p>` + nl,
441+
`<p>HSL stands for hue, saturation, and lightness. An example: <code>hsl(0, 100%, 50%)<span class="color-preview" style="background-color: hsl(0, 100%, 50%)"></span></code>.</p>` + nl,
442442
},
443443
{ // uppercase hsl
444444
"HSL stands for hue, saturation, and lightness. An example: `HSL(0, 100%, 50%)`.",
445-
`<p dir="auto">HSL stands for hue, saturation, and lightness. An example: <code>HSL(0, 100%, 50%)<span class="color-preview" style="background-color: HSL(0, 100%, 50%)"></span></code>.</p>` + nl,
445+
`<p>HSL stands for hue, saturation, and lightness. An example: <code>HSL(0, 100%, 50%)<span class="color-preview" style="background-color: HSL(0, 100%, 50%)"></span></code>.</p>` + nl,
446446
},
447447
}
448448

@@ -481,31 +481,31 @@ func TestMathBlock(t *testing.T) {
481481
}{
482482
{
483483
"$a$",
484-
`<p dir="auto"><code class="language-math is-loading">a</code></p>` + nl,
484+
`<p><code class="language-math is-loading">a</code></p>` + nl,
485485
},
486486
{
487487
"$ a $",
488-
`<p dir="auto"><code class="language-math is-loading">a</code></p>` + nl,
488+
`<p><code class="language-math is-loading">a</code></p>` + nl,
489489
},
490490
{
491491
"$a$ $b$",
492-
`<p dir="auto"><code class="language-math is-loading">a</code> <code class="language-math is-loading">b</code></p>` + nl,
492+
`<p><code class="language-math is-loading">a</code> <code class="language-math is-loading">b</code></p>` + nl,
493493
},
494494
{
495495
`\(a\) \(b\)`,
496-
`<p dir="auto"><code class="language-math is-loading">a</code> <code class="language-math is-loading">b</code></p>` + nl,
496+
`<p><code class="language-math is-loading">a</code> <code class="language-math is-loading">b</code></p>` + nl,
497497
},
498498
{
499499
`$a a$b b$`,
500-
`<p dir="auto"><code class="language-math is-loading">a a$b b</code></p>` + nl,
500+
`<p><code class="language-math is-loading">a a$b b</code></p>` + nl,
501501
},
502502
{
503503
`a a$b b`,
504-
`<p dir="auto">a a$b b</p>` + nl,
504+
`<p>a a$b b</p>` + nl,
505505
},
506506
{
507507
`a$b $a a$b b$`,
508-
`<p dir="auto">a$b <code class="language-math is-loading">a a$b b</code></p>` + nl,
508+
`<p>a$b <code class="language-math is-loading">a a$b b</code></p>` + nl,
509509
},
510510
{
511511
"$$a$$",

modules/markup/renderer.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,16 @@ const (
3030

3131
type ProcessorHelper struct {
3232
IsUsernameMentionable func(ctx context.Context, username string) bool
33+
34+
ElementDir string // the direction of the elements, eg: "ltr", "rtl", "auto", default to no direction attribute
3335
}
3436

35-
var processorHelper ProcessorHelper
37+
var DefaultProcessorHelper ProcessorHelper
3638

3739
// Init initialize regexps for markdown parsing
3840
func Init(ph *ProcessorHelper) {
3941
if ph != nil {
40-
processorHelper = *ph
42+
DefaultProcessorHelper = *ph
4143
}
4244

4345
NewSanitizer()

routers/api/v1/misc/markup_test.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ func TestAPI_RenderGFM(t *testing.T) {
115115
- [[Tips]]
116116
- Bezier widget (by @r-lyeh) https://github.com/ocornut/imgui/issues/786`,
117117
// rendered
118-
`<p dir="auto">Wiki! Enjoy :)</p>
119-
<ul dir="auto">
118+
`<p>Wiki! Enjoy :)</p>
119+
<ul>
120120
<li><a href="` + AppSubURL + `wiki/Links" rel="nofollow">Links, Language bindings, Engine bindings</a></li>
121121
<li><a href="` + AppSubURL + `wiki/Tips" rel="nofollow">Tips</a></li>
122122
<li>Bezier widget (by <a href="` + AppURL + `r-lyeh" rel="nofollow">@r-lyeh</a>) <a href="https://github.com/ocornut/imgui/issues/786" rel="nofollow">https://github.com/ocornut/imgui/issues/786</a></li>
@@ -125,12 +125,12 @@ func TestAPI_RenderGFM(t *testing.T) {
125125
// Guard wiki sidebar: special syntax
126126
`[[Guardfile-DSL / Configuring-Guard|Guardfile-DSL---Configuring-Guard]]`,
127127
// rendered
128-
`<p dir="auto"><a href="` + AppSubURL + `wiki/Guardfile-DSL---Configuring-Guard" rel="nofollow">Guardfile-DSL / Configuring-Guard</a></p>
128+
`<p><a href="` + AppSubURL + `wiki/Guardfile-DSL---Configuring-Guard" rel="nofollow">Guardfile-DSL / Configuring-Guard</a></p>
129129
`,
130130
// special syntax
131131
`[[Name|Link]]`,
132132
// rendered
133-
`<p dir="auto"><a href="` + AppSubURL + `wiki/Link" rel="nofollow">Name</a></p>
133+
`<p><a href="` + AppSubURL + `wiki/Link" rel="nofollow">Name</a></p>
134134
`,
135135
// empty
136136
``,
@@ -150,11 +150,11 @@ Here are some links to the most important topics. You can find the full list of
150150
[[images/icon-bug.png]]
151151
`,
152152
// rendered
153-
`<h2 id="user-content-what-is-wine-staging" dir="auto">What is Wine Staging?</h2>
154-
<p dir="auto"><strong>Wine Staging</strong> on website <a href="http://wine-staging.com" rel="nofollow">wine-staging.com</a>.</p>
155-
<h2 id="user-content-quick-links" dir="auto">Quick Links</h2>
156-
<p dir="auto">Here are some links to the most important topics. You can find the full list of pages at the sidebar.</p>
157-
<p dir="auto"><a href="` + AppSubURL + `wiki/Configuration" rel="nofollow">Configuration</a>
153+
`<h2 id="user-content-what-is-wine-staging">What is Wine Staging?</h2>
154+
<p><strong>Wine Staging</strong> on website <a href="http://wine-staging.com" rel="nofollow">wine-staging.com</a>.</p>
155+
<h2 id="user-content-quick-links">Quick Links</h2>
156+
<p>Here are some links to the most important topics. You can find the full list of pages at the sidebar.</p>
157+
<p><a href="` + AppSubURL + `wiki/Configuration" rel="nofollow">Configuration</a>
158158
<a href="` + AppSubURL + `wiki/raw/images/icon-bug.png" rel="nofollow"><img src="` + AppSubURL + `wiki/raw/images/icon-bug.png" title="icon-bug.png" alt="images/icon-bug.png"/></a></p>
159159
`,
160160
}
@@ -185,12 +185,12 @@ var simpleCases = []string{
185185
// Guard wiki sidebar: special syntax
186186
`[[Guardfile-DSL / Configuring-Guard|Guardfile-DSL---Configuring-Guard]]`,
187187
// rendered
188-
`<p dir="auto">[[Guardfile-DSL / Configuring-Guard|Guardfile-DSL---Configuring-Guard]]</p>
188+
`<p>[[Guardfile-DSL / Configuring-Guard|Guardfile-DSL---Configuring-Guard]]</p>
189189
`,
190190
// special syntax
191191
`[[Name|Link]]`,
192192
// rendered
193-
`<p dir="auto">[[Name|Link]]</p>
193+
`<p>[[Name|Link]]</p>
194194
`,
195195
// empty
196196
``,

services/markup/processorhelper.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313

1414
func ProcessorHelper() *markup.ProcessorHelper {
1515
return &markup.ProcessorHelper{
16+
ElementDir: "auto", // set dir="auto" for necessary (eg: <p>, <h?>, etc) tags
1617
IsUsernameMentionable: func(ctx context.Context, username string) bool {
1718
mentionedUser, err := user.GetUserByName(ctx, username)
1819
if err != nil {

0 commit comments

Comments
 (0)