Skip to content

Commit b0ac303

Browse files
committed
Address line length error
1 parent 8638274 commit b0ac303

File tree

1 file changed

+41
-6
lines changed
  • resources/asciidoctor/lib/elastic_compat_preprocessor

1 file changed

+41
-6
lines changed

resources/asciidoctor/lib/elastic_compat_preprocessor/extension.rb

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,31 @@ class ElasticCompatPreprocessor < Asciidoctor::Extensions::Preprocessor
124124
/^\["source", ?"[^"]+", ?subs="(#{Asciidoctor::CC_ANY}+)"\]$/
125125
CODE_BLOCK_RX = /^-----*$/
126126
SNIPPET_RX = %r{^//\s*(AUTOSENSE|KIBANA|CONSOLE|SENSE:[^\n<]+)$}
127-
LEGACY_MACROS = 'added|beta|coming|deprecated|dev|experimental|ga_stack|ga_serverless|ga_ess|beta_serverless|beta_ess|coming_serverless|coming_ess|deprecated_serverless|deprecated_ess|dev_serverless|dev_ess|preview_serverless|preview_ess|discontinued_stack|discontinued_ess|discontinued_serverless'
128-
LEGACY_BLOCK_MACRO_RX = /^\s*(#{LEGACY_MACROS})\[(.*)\]\s*$/
129-
LEGACY_INLINE_MACRO_RX = /(#{LEGACY_MACROS})\[(.*)\]/
127+
LEGACY = 'added|experimental'
128+
BETA = 'beta|beta_serverless|beta_ess'
129+
COMING = 'coming|coming_serverless|coming_ess'
130+
DEP = 'deprecated|deprecated_serverless|deprecated_ess'
131+
DEV = 'dev|dev_serverless|dev_ess'
132+
DISC = 'discontinued_stack|discontinued_ess|discontinued_serverless'
133+
GA = 'ga_stack|ga_serverless|ga_ess'
134+
PREV = 'preview_serverless|preview_ess'
135+
MACROS = "#{LEGACY}|#{BETA}|#{COMING}|#{DEP}|#{DEV}|#{DISC}|#{GA}|#{PREV}"
136+
BLOCK_MACRO_RX = /^\s*(#{MACROS})\[(.*)\]\s*$/
137+
INLINE_MACRO_RX = /(#{MACROS})\[(.*)\]/
138+
# BETA_BLOCK_MACRO_RX = /^\s*(#{BETA_MACROS})\[(.*)\]\s*$/
139+
# BETA_INLINE_MACRO_RX = /(#{BETA_MACROS})\[(.*)\]/
140+
# COMING_BLOCK_MACRO_RX = /^\s*(#{COMING_MACROS})\[(.*)\]\s*$/
141+
# COMING_INLINE_MACRO_RX = /(#{COMING_MACROS})\[(.*)\]/
142+
# DEP_BLOCK_MACRO_RX = /^\s*(#{DEP_MACROS})\[(.*)\]\s*$/
143+
# DEP_INLINE_MACRO_RX = /(#{DEP_MACROS})\[(.*)\]/
144+
# DEV_BLOCK_MACRO_RX = /^\s*(#{DEV_MACROS})\[(.*)\]\s*$/
145+
# DEV_INLINE_MACRO_RX = /(#{DEV_MACROS})\[(.*)\]/
146+
# DISC_BLOCK_MACRO_RX = /^\s*(#{DISC_MACROS})\[(.*)\]\s*$/
147+
# DISC_INLINE_MACRO_RX = /(#{DISC_MACROS})\[(.*)\]/
148+
# GA_BLOCK_MACRO_RX = /^\s*(#{GA_MACROS})\[(.*)\]\s*$/
149+
# GA_INLINE_MACRO_RX = /(#{GA_MACROS})\[(.*)\]/
150+
# PREV_BLOCK_MACRO_RX = /^\s*(#{PREV_MACROS})\[(.*)\]\s*$/
151+
# PREV_INLINE_MACRO_RX = /(#{PREV_MACROS})\[(.*)\]/
130152

131153
def process(_document, reader)
132154
reader.extend ReaderExtension
@@ -213,11 +235,24 @@ def postprocess(line)
213235

214236
# First convert the "block" version of these macros. We convert them
215237
# to block macros because they are alone on a line
216-
line.gsub!(LEGACY_BLOCK_MACRO_RX, '\1::[\2]')
238+
line.gsub!(BLOCK_MACRO_RX, '\1::[\2]')
239+
# line.gsub!(BETA_BLOCK_MACRO_RX, '\1::[\2]')
240+
# line.gsub!(COMING_BLOCK_MACRO_RX, '\1::[\2]')
241+
# line.gsub!(DEP_BLOCK_MACRO_RX, '\1::[\2]')
242+
# line.gsub!(DEV_BLOCK_MACRO_RX, '\1::[\2]')
243+
# line.gsub!(DISC_BLOCK_MACRO_RX, '\1::[\2]')
244+
# line.gsub!(GA_BLOCK_MACRO_RX, '\1::[\2]')
245+
# line.gsub!(PREV_BLOCK_MACRO_RX, '\1::[\2]')
217246
# Then convert the "inline" version of these macros. We convert them
218247
# to inline macros because they are *not* at the start of the line....
219-
line.gsub!(LEGACY_INLINE_MACRO_RX, '\1:[\2]')
220-
248+
line.gsub!(INLINE_MACRO_RX, '\1:[\2]')
249+
# line.gsub!(BETA_INLINE_MACRO_RX, '\1:[\2]')
250+
# line.gsub!(COMING_INLINE_MACRO_RX, '\1:[\2]')
251+
# line.gsub!(DEP_INLINE_MACRO_RX, '\1:[\2]')
252+
# line.gsub!(DEV_INLINE_MACRO_RX, '\1:[\2]')
253+
# line.gsub!(DISC_INLINE_MACRO_RX, '\1:[\2]')
254+
# line.gsub!(GA_INLINE_MACRO_RX, '\1:[\2]')
255+
# line.gsub!(PREV_INLINE_MACRO_RX, '\1:[\2]')
221256
# Transform Elastic's traditional comment based marking for
222257
# AUTOSENSE/KIBANA/CONSOLE snippets into a marker that we can pick
223258
# up during tree processing to turn the snippet into a marked up

0 commit comments

Comments
 (0)