documentation-editor 0.12.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecfee070c99db5a29d7229ac0bf8df1f57c86548
|
4
|
+
data.tar.gz: b412039cfaee837d03603b6d767ad5dcaa266c8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 898ca46790aec2c357b706c7a7bae0e0353e99abd31a9090e275cd610aca93fec98b97103f91cbed39446b213c5ce22f212c3a57b36f1bcf8512eac5c4d6dd54
|
7
|
+
data.tar.gz: 0ec239c7e58a9207d8910eef119e07a4fd1e84424e5aaae020afeaf52a0b95cccf71cd4e143020b6541ab69be74e75602770bedf7c5ff0b8e3b8258901d7cec1
|
@@ -4,8 +4,9 @@ module DocumentationEditor
|
|
4
4
|
|
5
5
|
def to_html(options = {})
|
6
6
|
options = defaulted(options)
|
7
|
-
options[:lower_title_levels] = DocumentationEditor::Config.lower_title_levels
|
8
7
|
html = parse_document(options).to_html
|
8
|
+
# lower titles
|
9
|
+
html.gsub!(/<h([1-6])/) { |m| "<h#{$1.to_i + 1}" } if DocumentationEditor::Config.lower_title_levels
|
9
10
|
# resolve the variables
|
10
11
|
html = resolve_variables(options, html)
|
11
12
|
# resolve the code condition block
|
@@ -56,8 +57,7 @@ module DocumentationEditor
|
|
56
57
|
|
57
58
|
private
|
58
59
|
def parse_document(options)
|
59
|
-
|
60
|
-
doc = Kramdown::Document.new(markdown_content, options.merge(input: 'BlockKramdown'))
|
60
|
+
doc = Kramdown::Document.new(content, options.merge(input: 'BlockKramdown'))
|
61
61
|
|
62
62
|
# apply the /if filtering
|
63
63
|
doc.root.children = apply_filtering(doc.root.children, options, [])
|