documentation-editor 0.12.0 → 0.12.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e2be27160f41ee85490c83d85b751c935771dcbd
4
- data.tar.gz: 82e49eb9fd73cc4927498c57217289fe2ba70e47
3
+ metadata.gz: ecfee070c99db5a29d7229ac0bf8df1f57c86548
4
+ data.tar.gz: b412039cfaee837d03603b6d767ad5dcaa266c8f
5
5
  SHA512:
6
- metadata.gz: d610cf14999eaf17070997e6b786b68875be7121f0194352d6b979b9fc0cc74bc4507448dda2a0f2a9188ce42808270705f8b607a744d3f708cd0a5405857255
7
- data.tar.gz: a5862abaae29bf7d6947afda0d99c8bfed19952fa5f8168cf052683a076776fc7192e5c2b658eba57bc2f51aecc137d4f1abb67ff073622360ca1faf2469e029
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
- markdown_content = options[:lower_title_levels] ? content.gsub(/^#/, '##') : content
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, [])
@@ -1,3 +1,3 @@
1
1
  module DocumentationEditor
2
- VERSION = "0.12.0"
2
+ VERSION = "0.12.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: documentation-editor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Algolia Team