Skip to content

Commit

Permalink
Remove dot from the top level section number
Browse files Browse the repository at this point in the history
  • Loading branch information
Kieun committed Apr 25, 2024
1 parent 724646f commit 1344534
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=0.0.10-SNAPTSHOT
version=0.0.10

org.gradle.caching=true
org.gradle.parallel=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ class DelegateHtml5Converter < Asciidoctor::Converter::Html5Converter
def convert_outline(node, opts = {})
outline = super

# Modify the TOC to wrap section numbers with a <span> tag for level 1 section
# Modify the TOC to remove the period after top-level section numbers and wrap the number with a <span> tag
if outline != nil && node.node_name == "document"
outline.gsub!(/(<a href="#.+?>)(\d+)(\.)(\s+)/) do
"#{$1}<span class=\"sectnum\">#{$2}</span>#{$3}#{$4}"
"#{$1}<span class=\"sectnum\">#{$2}</span>#{$4}" # Removed #{$3} which represents the period
end
end

Expand Down

0 comments on commit 1344534

Please sign in to comment.