Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
bdc867d1
Commit
bdc867d1
authored
Dec 16, 2023
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: heading render
parent
6421fbc6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
html.go
plugin/gomark/render/html/html.go
+1
-1
html_test.go
plugin/gomark/render/html/html_test.go
+4
-0
No files found.
plugin/gomark/render/html/html.go
View file @
bdc867d1
...
...
@@ -96,7 +96,7 @@ func (r *HTMLRender) renderCodeBlock(node *ast.CodeBlock) {
}
func
(
r
*
HTMLRender
)
renderHeading
(
node
*
ast
.
Heading
)
{
element
:=
fmt
.
Sprintf
(
"
<h%d>
"
,
node
.
Level
)
element
:=
fmt
.
Sprintf
(
"
h%d
"
,
node
.
Level
)
r
.
output
.
WriteString
(
fmt
.
Sprintf
(
"<%s>"
,
element
))
r
.
RenderNodes
(
node
.
Children
)
r
.
output
.
WriteString
(
fmt
.
Sprintf
(
"</%s>"
,
element
))
...
...
plugin/gomark/render/html/html_test.go
View file @
bdc867d1
...
...
@@ -18,6 +18,10 @@ func TestHTMLRender(t *testing.T) {
text
:
"Hello world!"
,
expected
:
`<p>Hello world!</p>`
,
},
{
text
:
"# Hello world!"
,
expected
:
`<h1>Hello world!</h1>`
,
},
{
text
:
"> Hello
\n
> world!"
,
expected
:
`<blockquote>Hello<br>world!</blockquote>`
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment