summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/asciidoctor.rb8
-rw-r--r--lib/asciidoctor/parser.rb6
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/asciidoctor.rb b/lib/asciidoctor.rb
index f6812b3e..0ea5f1b3 100644
--- a/lib/asciidoctor.rb
+++ b/lib/asciidoctor.rb
@@ -654,14 +654,14 @@ module Asciidoctor
# NOTE uppercase chars are not included since the expression is used on a lowercased string
InvalidSectionIdCharsRx = /&(?:[a-z][a-z]+\d{0,2}|#\d\d\d{0,4}|#x[\da-f][\da-f][\da-f]{0,3});|[^#{CC_WORD}]+?/
- # Matches the block style used to designate a section title as a floating title.
+ # Matches the block style used to designate a discrete (aka free-floating) heading.
#
# Examples
#
- # [float]
- # = Floating Title
+ # [discrete]
+ # = Discrete Heading
#
- FloatingTitleStyleRx = /^(?:float|discrete)\b/
+ DiscreteHeadingStyleRx = /^(?:discrete|float)\b/
## Lists
diff --git a/lib/asciidoctor/parser.rb b/lib/asciidoctor/parser.rb
index a8816a00..7872e795 100644
--- a/lib/asciidoctor/parser.rb
+++ b/lib/asciidoctor/parser.rb
@@ -734,8 +734,8 @@ class Parser
lines.pop while lines[-1].empty?
end
attributes['style'] = 'quote'
- # NOTE will only detect headings that are floating titles (not section titles)
- # TODO could assume a floating title when inside a block context
+ # NOTE will only detect discrete (aka free-floating) headings
+ # TODO could assume a discrete heading when inside a block context
# FIXME Reader needs to be created w/ line info
block = build_block(:quote, :compound, false, parent, Reader.new(lines), attributes)
elsif ch0 == '"' && lines.size > 1 && (lines[-1].start_with? '-- ') && (lines[-2].end_with? '"')
@@ -1606,7 +1606,7 @@ class Parser
#
# Returns the Integer section level if the Reader is positioned at a section title or nil otherwise
def self.is_next_line_section?(reader, attributes)
- if attributes.key?(1) && (attr1 = attributes[1] || '').start_with?('float', 'discrete') && FloatingTitleStyleRx.match?(attr1)
+ if (style = attributes[1]) && (style.start_with? 'discrete', 'float') && (DiscreteHeadingStyleRx.match? style)
return
elsif reader.has_more_lines?
Compliance.underline_style_section_titles ? is_section_title?(*reader.peek_lines(2, true)) : is_single_line_section_title?(reader.peek_line)