@asciidoctor/core 2.2.6 → 2.2.8

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.
@@ -1295,6 +1295,30 @@ Opal.modules["asciidoctor/js/opal_ext/string"] = function(Opal) {
1295
1295
  })($nesting[0], null, $nesting)
1296
1296
  };
1297
1297
 
1298
+ /* Generated by Opal 0.11.99.dev */
1299
+ Opal.modules["asciidoctor/js/opal_ext/array"] = function(Opal) {
1300
+ var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass;
1301
+
1302
+ Opal.add_stubs(['$==', '$strict_encode64', '$_original_pack']);
1303
+ return (function($base, $super, $parent_nesting) {
1304
+ var self = $klass($base, $super, 'Array');
1305
+
1306
+ var $nesting = [self].concat($parent_nesting), $Array_pack$1;
1307
+
1308
+
1309
+ Opal.alias(self, "_original_pack", "pack");
1310
+ return (Opal.def(self, '$pack', $Array_pack$1 = function $$pack(format) {
1311
+ var self = this;
1312
+
1313
+ if (format['$==']("m0")) {
1314
+ return $$$('::', 'Base64').$strict_encode64(self)
1315
+ } else {
1316
+ return self.$_original_pack(self)
1317
+ }
1318
+ }, $Array_pack$1.$$arity = 1), nil) && 'pack';
1319
+ })($nesting[0], null, $nesting)
1320
+ };
1321
+
1298
1322
  /* Generated by Opal 0.11.99.dev */
1299
1323
  Opal.modules["asciidoctor/js/opal_ext/uri"] = function(Opal) {
1300
1324
  var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module;
@@ -1434,6 +1458,7 @@ Opal.modules["asciidoctor/js/opal_ext"] = function(Opal) {
1434
1458
  self.$require("asciidoctor/js/opal_ext/file");
1435
1459
  self.$require("asciidoctor/js/opal_ext/match_data");
1436
1460
  self.$require("asciidoctor/js/opal_ext/string");
1461
+ self.$require("asciidoctor/js/opal_ext/array");
1437
1462
  self.$require("asciidoctor/js/opal_ext/uri");
1438
1463
  self.$require("asciidoctor/js/opal_ext/base64");
1439
1464
  self.$require("asciidoctor/js/opal_ext/number");
@@ -2043,7 +2068,7 @@ Opal.modules["asciidoctor/helpers"] = function(Opal) {
2043
2068
  }
2044
2069
  var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $truthy = Opal.truthy, $gvars = Opal.gvars, $send = Opal.send, $hash2 = Opal.hash2;
2045
2070
 
2046
- Opal.add_stubs(['$module_function', '$require', '$include?', '$include', '$==', '$===', '$path', '$message', '$raise', '$warn', '$logger', '$chomp', '$empty?', '$slice', '$unpack', '$[]', '$byteslice', '$bytesize', '$[]=', '$-', '$map', '$rstrip', '$encode', '$encoding', '$nil_or_empty?', '$!=', '$tap', '$each_line', '$<<', '$match?', '$gsub', '$rindex', '$index', '$basename', '$extname', '$!', '$length', '$directory?', '$dirname', '$mkdir_p', '$mkdir', '$private_constant', '$join', '$divmod', '$*', '$+', '$to_s', '$to_i', '$succ', '$class_for_name', '$const_get']);
2071
+ Opal.add_stubs(['$module_function', '$require', '$include?', '$include', '$==', '$===', '$path', '$message', '$raise', '$warn', '$logger', '$chomp', '$empty?', '$slice', '$unpack', '$[]', '$byteslice', '$bytesize', '$[]=', '$-', '$map', '$rstrip', '$encode', '$encoding', '$nil_or_empty?', '$!=', '$tap', '$each_line', '$<<', '$!', '$start_with?', '$match?', '$gsub', '$rindex', '$index', '$basename', '$extname', '$length', '$directory?', '$dirname', '$mkdir_p', '$mkdir', '$private_constant', '$join', '$divmod', '$*', '$+', '$to_s', '$to_i', '$succ', '$class_for_name', '$const_get']);
2047
2072
  return (function($base, $parent_nesting) {
2048
2073
  var self = $module($base, 'Asciidoctor');
2049
2074
 
@@ -2052,7 +2077,7 @@ Opal.modules["asciidoctor/helpers"] = function(Opal) {
2052
2077
  (function($base, $parent_nesting) {
2053
2078
  var self = $module($base, 'Helpers');
2054
2079
 
2055
- var $nesting = [self].concat($parent_nesting), $Helpers_require_library$1, $Helpers_prepare_source_array$2, $Helpers_prepare_source_string$11, $Helpers_uriish$ques$16, $Helpers_encode_uri_component$17, $Helpers_encode_spaces_in_uri$18, $Helpers_rootname$19, $Helpers_basename$20, $Helpers_extname$ques$21, $Helpers_extname$22, $Helpers_extname$23, $Helpers_mkdir_p$24, $Helpers_int_to_roman$25, $Helpers_nextval$27, $Helpers_resolve_class$28, $Helpers_class_for_name$29;
2080
+ var $nesting = [self].concat($parent_nesting), $Helpers_require_library$1, $Helpers_prepare_source_array$2, $Helpers_prepare_source_string$11, $Helpers_uriish$ques$16, $Helpers_uriish$ques$17, $Helpers_encode_uri_component$18, $Helpers_encode_spaces_in_uri$19, $Helpers_rootname$20, $Helpers_basename$21, $Helpers_extname$ques$22, $Helpers_extname$23, $Helpers_extname$24, $Helpers_mkdir_p$25, $Helpers_int_to_roman$26, $Helpers_nextval$28, $Helpers_resolve_class$29, $Helpers_class_for_name$30;
2056
2081
 
2057
2082
 
2058
2083
  self.$module_function();
@@ -2281,15 +2306,24 @@ Opal.modules["asciidoctor/helpers"] = function(Opal) {
2281
2306
  return lines['$<<'](line.$chomp());}, $$15.$$s = self, $$15.$$arity = 1, $$15));}, $$14.$$s = self, $$14.$$arity = 1, $$14))
2282
2307
  };
2283
2308
  }, $Helpers_prepare_source_string$11.$$arity = -2);
2284
-
2285
- Opal.def(self, '$uriish?', $Helpers_uriish$ques$16 = function(str) {
2286
- var $a, self = this;
2309
+ if ($$$('::', 'RUBY_ENGINE')['$==']("jruby")) {
2310
+
2311
+ Opal.def(self, '$uriish?', $Helpers_uriish$ques$16 = function(str) {
2312
+ var $a, $b, self = this;
2313
+
2314
+ return ($truthy($a = ($truthy($b = str['$include?'](":")) ? str['$start_with?']("uri:classloader:")['$!']() : $b)) ? $$($nesting, 'UriSniffRx')['$match?'](str) : $a)
2315
+ }, $Helpers_uriish$ques$16.$$arity = 1)
2316
+ } else {
2317
+
2318
+ Opal.def(self, '$uriish?', $Helpers_uriish$ques$17 = function(str) {
2319
+ var $a, self = this;
2287
2320
 
2288
- return ($truthy($a = str['$include?'](":")) ? $$($nesting, 'UriSniffRx')['$match?'](str) : $a)
2289
- }, $Helpers_uriish$ques$16.$$arity = 1);
2321
+ return ($truthy($a = str['$include?'](":")) ? $$($nesting, 'UriSniffRx')['$match?'](str) : $a)
2322
+ }, $Helpers_uriish$ques$17.$$arity = 1)
2323
+ };
2290
2324
  if ($$($nesting, 'RUBY_ENGINE')['$==']("opal")) {
2291
2325
 
2292
- Opal.def(self, '$encode_uri_component', $Helpers_encode_uri_component$17 = function $$encode_uri_component(str) {
2326
+ Opal.def(self, '$encode_uri_component', $Helpers_encode_uri_component$18 = function $$encode_uri_component(str) {
2293
2327
  var self = this;
2294
2328
 
2295
2329
 
@@ -2297,12 +2331,12 @@ Opal.modules["asciidoctor/helpers"] = function(Opal) {
2297
2331
  return m === '%20' ? '+' : '%' + m.charCodeAt(0).toString(16)
2298
2332
  })
2299
2333
 
2300
- }, $Helpers_encode_uri_component$17.$$arity = 1)
2334
+ }, $Helpers_encode_uri_component$18.$$arity = 1)
2301
2335
  } else {
2302
2336
  nil
2303
2337
  };
2304
2338
 
2305
- Opal.def(self, '$encode_spaces_in_uri', $Helpers_encode_spaces_in_uri$18 = function $$encode_spaces_in_uri(str) {
2339
+ Opal.def(self, '$encode_spaces_in_uri', $Helpers_encode_spaces_in_uri$19 = function $$encode_spaces_in_uri(str) {
2306
2340
  var self = this;
2307
2341
 
2308
2342
  if ($truthy(str['$include?'](" "))) {
@@ -2311,9 +2345,9 @@ Opal.modules["asciidoctor/helpers"] = function(Opal) {
2311
2345
  } else {
2312
2346
  return str
2313
2347
  }
2314
- }, $Helpers_encode_spaces_in_uri$18.$$arity = 1);
2348
+ }, $Helpers_encode_spaces_in_uri$19.$$arity = 1);
2315
2349
 
2316
- Opal.def(self, '$rootname', $Helpers_rootname$19 = function $$rootname(filename) {
2350
+ Opal.def(self, '$rootname', $Helpers_rootname$20 = function $$rootname(filename) {
2317
2351
  var self = this, last_dot_idx = nil;
2318
2352
 
2319
2353
  if ($truthy((last_dot_idx = filename.$rindex(".")))) {
@@ -2326,9 +2360,9 @@ Opal.modules["asciidoctor/helpers"] = function(Opal) {
2326
2360
  } else {
2327
2361
  return filename
2328
2362
  }
2329
- }, $Helpers_rootname$19.$$arity = 1);
2363
+ }, $Helpers_rootname$20.$$arity = 1);
2330
2364
 
2331
- Opal.def(self, '$basename', $Helpers_basename$20 = function $$basename(filename, drop_ext) {
2365
+ Opal.def(self, '$basename', $Helpers_basename$21 = function $$basename(filename, drop_ext) {
2332
2366
  var self = this;
2333
2367
 
2334
2368
 
@@ -2346,16 +2380,16 @@ Opal.modules["asciidoctor/helpers"] = function(Opal) {
2346
2380
  } else {
2347
2381
  return $$$('::', 'File').$basename(filename)
2348
2382
  };
2349
- }, $Helpers_basename$20.$$arity = -2);
2383
+ }, $Helpers_basename$21.$$arity = -2);
2350
2384
 
2351
- Opal.def(self, '$extname?', $Helpers_extname$ques$21 = function(path) {
2385
+ Opal.def(self, '$extname?', $Helpers_extname$ques$22 = function(path) {
2352
2386
  var $a, self = this, last_dot_idx = nil;
2353
2387
 
2354
2388
  return ($truthy($a = (last_dot_idx = path.$rindex("."))) ? path.$index("/", last_dot_idx)['$!']() : $a)
2355
- }, $Helpers_extname$ques$21.$$arity = 1);
2389
+ }, $Helpers_extname$ques$22.$$arity = 1);
2356
2390
  if ($truthy($$$($$$('::', 'File'), 'ALT_SEPARATOR'))) {
2357
2391
 
2358
- Opal.def(self, '$extname', $Helpers_extname$22 = function $$extname(path, fallback) {
2392
+ Opal.def(self, '$extname', $Helpers_extname$23 = function $$extname(path, fallback) {
2359
2393
  var $a, self = this, last_dot_idx = nil;
2360
2394
 
2361
2395
 
@@ -2373,10 +2407,10 @@ Opal.modules["asciidoctor/helpers"] = function(Opal) {
2373
2407
  } else {
2374
2408
  return fallback
2375
2409
  };
2376
- }, $Helpers_extname$22.$$arity = -2)
2410
+ }, $Helpers_extname$23.$$arity = -2)
2377
2411
  } else {
2378
2412
 
2379
- Opal.def(self, '$extname', $Helpers_extname$23 = function $$extname(path, fallback) {
2413
+ Opal.def(self, '$extname', $Helpers_extname$24 = function $$extname(path, fallback) {
2380
2414
  var self = this, last_dot_idx = nil;
2381
2415
 
2382
2416
 
@@ -2394,10 +2428,10 @@ Opal.modules["asciidoctor/helpers"] = function(Opal) {
2394
2428
  } else {
2395
2429
  return fallback
2396
2430
  };
2397
- }, $Helpers_extname$23.$$arity = -2)
2431
+ }, $Helpers_extname$24.$$arity = -2)
2398
2432
  };
2399
2433
 
2400
- Opal.def(self, '$mkdir_p', $Helpers_mkdir_p$24 = function $$mkdir_p(dir) {
2434
+ Opal.def(self, '$mkdir_p', $Helpers_mkdir_p$25 = function $$mkdir_p(dir) {
2401
2435
  var self = this, parent_dir = nil;
2402
2436
 
2403
2437
  if ($truthy($$$('::', 'File')['$directory?'](dir))) {
@@ -2423,14 +2457,14 @@ Opal.modules["asciidoctor/helpers"] = function(Opal) {
2423
2457
  } else { throw $err; }
2424
2458
  };;
2425
2459
  }
2426
- }, $Helpers_mkdir_p$24.$$arity = 1);
2460
+ }, $Helpers_mkdir_p$25.$$arity = 1);
2427
2461
  Opal.const_set($nesting[0], 'ROMAN_NUMERALS', $hash2(["M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"], {"M": 1000, "CM": 900, "D": 500, "CD": 400, "C": 100, "XC": 90, "L": 50, "XL": 40, "X": 10, "IX": 9, "V": 5, "IV": 4, "I": 1}));
2428
2462
  self.$private_constant("ROMAN_NUMERALS");
2429
2463
 
2430
- Opal.def(self, '$int_to_roman', $Helpers_int_to_roman$25 = function $$int_to_roman(val) {
2431
- var $$26, self = this;
2464
+ Opal.def(self, '$int_to_roman', $Helpers_int_to_roman$26 = function $$int_to_roman(val) {
2465
+ var $$27, self = this;
2432
2466
 
2433
- return $send($$($nesting, 'ROMAN_NUMERALS'), 'map', [], ($$26 = function(l, i){var self = $$26.$$s || this, $a, $b, repeat = nil;
2467
+ return $send($$($nesting, 'ROMAN_NUMERALS'), 'map', [], ($$27 = function(l, i){var self = $$27.$$s || this, $a, $b, repeat = nil;
2434
2468
 
2435
2469
 
2436
2470
 
@@ -2442,10 +2476,10 @@ Opal.modules["asciidoctor/helpers"] = function(Opal) {
2442
2476
  i = nil;
2443
2477
  };
2444
2478
  $b = val.$divmod(i), $a = Opal.to_ary($b), (repeat = ($a[0] == null ? nil : $a[0])), (val = ($a[1] == null ? nil : $a[1])), $b;
2445
- return $rb_times(l, repeat);}, $$26.$$s = self, $$26.$$arity = 2, $$26)).$join()
2446
- }, $Helpers_int_to_roman$25.$$arity = 1);
2479
+ return $rb_times(l, repeat);}, $$27.$$s = self, $$27.$$arity = 2, $$27)).$join()
2480
+ }, $Helpers_int_to_roman$26.$$arity = 1);
2447
2481
 
2448
- Opal.def(self, '$nextval', $Helpers_nextval$27 = function $$nextval(current) {
2482
+ Opal.def(self, '$nextval', $Helpers_nextval$28 = function $$nextval(current) {
2449
2483
  var self = this, intval = nil;
2450
2484
 
2451
2485
  if ($truthy($$$('::', 'Integer')['$==='](current))) {
@@ -2455,9 +2489,9 @@ Opal.modules["asciidoctor/helpers"] = function(Opal) {
2455
2489
  } else {
2456
2490
  return current.$succ()
2457
2491
  }
2458
- }, $Helpers_nextval$27.$$arity = 1);
2492
+ }, $Helpers_nextval$28.$$arity = 1);
2459
2493
 
2460
- Opal.def(self, '$resolve_class', $Helpers_resolve_class$28 = function $$resolve_class(object) {
2494
+ Opal.def(self, '$resolve_class', $Helpers_resolve_class$29 = function $$resolve_class(object) {
2461
2495
  var self = this;
2462
2496
 
2463
2497
  if ($truthy($$$('::', 'Class')['$==='](object))) {
@@ -2471,9 +2505,9 @@ Opal.modules["asciidoctor/helpers"] = function(Opal) {
2471
2505
  return nil
2472
2506
  };
2473
2507
  }
2474
- }, $Helpers_resolve_class$28.$$arity = 1);
2508
+ }, $Helpers_resolve_class$29.$$arity = 1);
2475
2509
 
2476
- Opal.def(self, '$class_for_name', $Helpers_class_for_name$29 = function $$class_for_name(qualified_name) {
2510
+ Opal.def(self, '$class_for_name', $Helpers_class_for_name$30 = function $$class_for_name(qualified_name) {
2477
2511
  var self = this, resolved = nil;
2478
2512
 
2479
2513
  try {
@@ -2490,7 +2524,7 @@ Opal.modules["asciidoctor/helpers"] = function(Opal) {
2490
2524
  } finally { Opal.pop_exception() }
2491
2525
  } else { throw $err; }
2492
2526
  }
2493
- }, $Helpers_class_for_name$29.$$arity = 1);
2527
+ }, $Helpers_class_for_name$30.$$arity = 1);
2494
2528
  })($nesting[0], $nesting)
2495
2529
  })($nesting[0], $nesting)
2496
2530
  };
@@ -2860,9 +2894,11 @@ Opal.modules["asciidoctor/logging"] = function(Opal) {
2860
2894
  self.$attr_reader("messages");
2861
2895
 
2862
2896
  Opal.def(self, '$initialize', $MemoryLogger_initialize$6 = function $$initialize() {
2863
- var self = this, $writer = nil;
2897
+ var $iter = $MemoryLogger_initialize$6.$$p, $yield = $iter || nil, self = this, $writer = nil;
2864
2898
 
2899
+ if ($iter) $MemoryLogger_initialize$6.$$p = null;
2865
2900
 
2901
+ $send(self, Opal.find_super_dispatcher(self, 'initialize', $MemoryLogger_initialize$6, false), [nil], null);
2866
2902
 
2867
2903
  $writer = [$$($nesting, 'WARN')];
2868
2904
  $send(self, 'level=', Opal.to_a($writer));
@@ -2930,12 +2966,15 @@ Opal.modules["asciidoctor/logging"] = function(Opal) {
2930
2966
  self.$attr_reader("max_severity");
2931
2967
 
2932
2968
  Opal.def(self, '$initialize', $NullLogger_initialize$12 = function $$initialize() {
2933
- var self = this, $writer = nil;
2969
+ var $iter = $NullLogger_initialize$12.$$p, $yield = $iter || nil, self = this, $writer = nil;
2934
2970
 
2971
+ if ($iter) $NullLogger_initialize$12.$$p = null;
2972
+
2973
+ $send(self, Opal.find_super_dispatcher(self, 'initialize', $NullLogger_initialize$12, false), [nil], null);
2935
2974
 
2936
2975
  $writer = [$$($nesting, 'WARN')];
2937
2976
  $send(self, 'level=', Opal.to_a($writer));
2938
- return $writer[$rb_minus($writer["length"], 1)];
2977
+ return $writer[$rb_minus($writer["length"], 1)];;
2939
2978
  }, $NullLogger_initialize$12.$$arity = 0);
2940
2979
  return (Opal.def(self, '$add', $NullLogger_add$13 = function $$add(severity, message, progname) {
2941
2980
  var $a, self = this;
@@ -3064,7 +3103,7 @@ Opal.modules["asciidoctor/rx"] = function(Opal) {
3064
3103
  Opal.const_set($nesting[0], 'ManpageNamePurposeRx', new RegExp("" + "^(" + ($$($nesting, 'CC_ANY')) + "+?) +- +(" + ($$($nesting, 'CC_ANY')) + "+)$"));
3065
3104
  Opal.const_set($nesting[0], 'ConditionalDirectiveRx', new RegExp("" + "^(\\\\)?(ifdef|ifndef|ifeval|endif)::(\\S*?(?:([,+])\\S*?)?)\\[(" + ($$($nesting, 'CC_ANY')) + "+)?\\]$"));
3066
3105
  Opal.const_set($nesting[0], 'EvalExpressionRx', new RegExp("" + "^(" + ($$($nesting, 'CC_ANY')) + "+?) *([=!><]=|[><]) *(" + ($$($nesting, 'CC_ANY')) + "+)$"));
3067
- Opal.const_set($nesting[0], 'IncludeDirectiveRx', new RegExp("" + "^(\\\\)?include::([^\\[][^\\[]*)\\[(" + ($$($nesting, 'CC_ANY')) + "+)?\\]$"));
3106
+ Opal.const_set($nesting[0], 'IncludeDirectiveRx', new RegExp("" + "^(\\\\)?include::([^\\s\\[](?:[^\\[]*[^\\s\\[])?)\\[(" + ($$($nesting, 'CC_ANY')) + "+)?\\]$"));
3068
3107
  Opal.const_set($nesting[0], 'TagDirectiveRx', /\b(?:tag|(e)nd)::(\S+?)\[\](?=$|[ \r])/m);
3069
3108
  Opal.const_set($nesting[0], 'AttributeEntryRx', new RegExp("" + "^:(!?" + ($$($nesting, 'CG_WORD')) + "[^:]*):(?:[ \\t]+(" + ($$($nesting, 'CC_ANY')) + "*))?$"));
3070
3109
  Opal.const_set($nesting[0], 'InvalidAttributeNameCharsRx', new RegExp("" + "[^" + ($$($nesting, 'CC_WORD')) + "-]"));
@@ -3150,14 +3189,17 @@ Opal.modules["asciidoctor/rx"] = function(Opal) {
3150
3189
  Opal.const_set($nesting[0], 'InlineImageMacroRx', new RegExp("" + "\\\\?i(?:mage|con):([^:\\s\\[](?:[^\\n\\[]*[^\\s\\[])?)\\[(|" + ($$($nesting, 'CC_ALL')) + "*?[^\\\\])\\]", 'm'));
3151
3190
  Opal.const_set($nesting[0], 'InlineIndextermMacroRx', new RegExp("" + "\\\\?(?:(indexterm2?):\\[(" + ($$($nesting, 'CC_ALL')) + "*?[^\\\\])\\]|\\(\\((" + ($$($nesting, 'CC_ALL')) + "+?)\\)\\)(?!\\)))", 'm'));
3152
3191
  Opal.const_set($nesting[0], 'InlineKbdBtnMacroRx', new RegExp("" + "(\\\\)?(kbd|btn):\\[(" + ($$($nesting, 'CC_ALL')) + "*?[^\\\\])\\]", 'm'));
3153
- Opal.const_set($nesting[0], 'InlineLinkRx', new RegExp("" + "(^|link:|" + ($$($nesting, 'CG_BLANK')) + "|&lt;|[>\\(\\)\\[\\];\"'])(\\\\?(?:https?|file|ftp|irc)://[^\\s\\[\\]<]*([^\\s.,\\[\\]<]))(?:\\[(|" + ($$($nesting, 'CC_ALL')) + "*?[^\\\\])\\])?", 'm'));
3192
+ if ($$($nesting, 'RUBY_ENGINE')['$==']("opal")) {
3193
+ Opal.const_set($nesting[0], 'InlineLinkRx', new RegExp("" + "(^|link:|" + ($$($nesting, 'CG_BLANK')) + "|\\\\?&lt;(?=\\\\?(?:https?|file|ftp|irc)(:))|[>\\(\\)\\[\\];\"'])(\\\\?(?:https?|file|ftp|irc)://)(?:([^\\s\\[\\]]+)\\[(|" + ($$($nesting, 'CC_ALL')) + "*?[^\\\\])\\]|(?!\\2)([^\\s]+?)&gt;|([^\\s\\[\\]<]*([^\\s,.?!\\[\\]<\\)])))"))
3194
+ } else {
3195
+ nil
3196
+ };
3154
3197
  Opal.const_set($nesting[0], 'InlineLinkMacroRx', new RegExp("" + "\\\\?(?:link|(mailto)):(|[^:\\s\\[][^\\s\\[]*)\\[(|" + ($$($nesting, 'CC_ALL')) + "*?[^\\\\])\\]", 'm'));
3155
3198
  Opal.const_set($nesting[0], 'MacroNameRx', new RegExp("" + "^" + ($$($nesting, 'CG_WORD')) + "[" + ($$($nesting, 'CC_WORD')) + "-]*$"));
3156
3199
  Opal.const_set($nesting[0], 'InlineStemMacroRx', new RegExp("" + "\\\\?(stem|(?:latex|ascii)math):([a-z]+(?:,[a-z-]+)*)?\\[(" + ($$($nesting, 'CC_ALL')) + "*?[^\\\\])\\]", 'm'));
3157
3200
  Opal.const_set($nesting[0], 'InlineMenuMacroRx', new RegExp("" + "\\\\?menu:(" + ($$($nesting, 'CG_WORD')) + "|[" + ($$($nesting, 'CC_WORD')) + "&][^\\n\\[]*[^\\s\\[])\\[ *(?:|(" + ($$($nesting, 'CC_ALL')) + "*?[^\\\\]))\\]", 'm'));
3158
3201
  Opal.const_set($nesting[0], 'InlineMenuRx', new RegExp("" + "\\\\?\"([" + ($$($nesting, 'CC_WORD')) + "&][^\"]*?[ \\n]+&gt;[ \\n]+[^\"]*)\""));
3159
- Opal.const_set($nesting[0], 'InlinePassRx', $hash(false, ["+", "`", new RegExp("" + "(^|[^" + ($$($nesting, 'CC_WORD')) + ";:])(?:\\[([^\\]]+)\\])?(\\\\?(\\+|`)(\\S|\\S" + ($$($nesting, 'CC_ALL')) + "*?\\S)\\4)(?!" + ($$($nesting, 'CG_WORD')) + ")", 'm')], true, ["`", nil, new RegExp("" + "(^|[^`" + ($$($nesting, 'CC_WORD')) + "])(?:\\[([^\\]]+)\\])?(\\\\?(`)([^`\\s]|[^`\\s]" + ($$($nesting, 'CC_ALL')) + "*?\\S)\\4)(?![`" + ($$($nesting, 'CC_WORD')) + "])", 'm')]));
3160
- Opal.const_set($nesting[0], 'SinglePlusInlinePassRx', new RegExp("" + "^(\\\\)?\\+(\\S|\\S" + ($$($nesting, 'CC_ALL')) + "*?\\S)\\+$", 'm'));
3202
+ Opal.const_set($nesting[0], 'InlinePassRx', $hash(false, ["+", "-]", new RegExp("" + "((?:^|[^" + ($$($nesting, 'CC_WORD')) + ";:\\\\])(?=(\\[)|\\+)|\\\\(?=\\[)|(?=\\\\\\+))(?:\\2(x-|[^\\]]+ x-)\\]|(?:\\[([^\\]]+)\\])?(?=(\\\\)?\\+))(\\5?(\\+|`)(\\S|\\S" + ($$($nesting, 'CC_ALL')) + "*?\\S)\\7)(?!" + ($$($nesting, 'CG_WORD')) + ")", 'm')], true, ["`", nil, new RegExp("" + "(^|[^`" + ($$($nesting, 'CC_WORD')) + "])(?:(\\Z)()|\\[([^\\]]+)\\](?=(\\\\))?)?(\\5?(`)([^`\\s]|[^`\\s]" + ($$($nesting, 'CC_ALL')) + "*?\\S)\\7)(?![`" + ($$($nesting, 'CC_WORD')) + "])", 'm')]));
3161
3203
  Opal.const_set($nesting[0], 'InlinePassMacroRx', new RegExp("" + "(?:(?:(\\\\?)\\[([^\\]]+)\\])?(\\\\{0,2})(\\+\\+\\+?|\\$\\$)(" + ($$($nesting, 'CC_ALL')) + "*?)\\4|(\\\\?)pass:([a-z]+(?:,[a-z-]+)*)?\\[(|" + ($$($nesting, 'CC_ALL')) + "*?[^\\\\])\\])", 'm'));
3162
3204
  Opal.const_set($nesting[0], 'InlineXrefMacroRx', new RegExp("" + "\\\\?(?:&lt;&lt;([" + ($$($nesting, 'CC_WORD')) + "#/.:{]" + ($$($nesting, 'CC_ALL')) + "*?)&gt;&gt;|xref:([" + ($$($nesting, 'CC_WORD')) + "#/.:{]" + ($$($nesting, 'CC_ALL')) + "*?)\\[(?:\\]|(" + ($$($nesting, 'CC_ALL')) + "*?[^\\\\])\\]))", 'm'));
3163
3205
  if ($$($nesting, 'RUBY_ENGINE')['$==']("opal")) {
@@ -3173,7 +3215,11 @@ Opal.modules["asciidoctor/rx"] = function(Opal) {
3173
3215
  Opal.const_set($nesting[0], 'SpaceDelimiterRx', /([^\\])[ \t\n]+/);
3174
3216
  Opal.const_set($nesting[0], 'SubModifierSniffRx', /[+-]/);
3175
3217
  Opal.const_set($nesting[0], 'TrailingDigitsRx', /\d+$/);
3176
- Opal.const_set($nesting[0], 'UriSniffRx', new RegExp("" + "^" + ($$($nesting, 'CG_ALPHA')) + "[" + ($$($nesting, 'CC_ALNUM')) + ".+-]+:/{0,2}"));
3218
+ if ($$($nesting, 'RUBY_ENGINE')['$==']("opal")) {
3219
+ Opal.const_set($nesting[0], 'UriSniffRx', new RegExp("" + "^" + ($$($nesting, 'CG_ALPHA')) + "[" + ($$($nesting, 'CC_ALNUM')) + ".+-]+:/{0,2}"))
3220
+ } else {
3221
+ nil
3222
+ };
3177
3223
  Opal.const_set($nesting[0], 'XmlSanitizeRx', /<[^>]+>/);
3178
3224
  })($nesting[0], $nesting)
3179
3225
  };
@@ -3197,7 +3243,7 @@ Opal.modules["asciidoctor/substitutors"] = function(Opal) {
3197
3243
  }
3198
3244
  var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $hash2 = Opal.hash2, $hash = Opal.hash, $truthy = Opal.truthy, $send = Opal.send, $gvars = Opal.gvars;
3199
3245
 
3200
- Opal.add_stubs(['$freeze', '$+', '$keys', '$empty?', '$!', '$===', '$[]', '$join', '$include?', '$extract_passthroughs', '$each', '$sub_specialchars', '$sub_quotes', '$sub_attributes', '$sub_replacements', '$sub_macros', '$highlight_source', '$sub_callouts', '$sub_post_replacements', '$warn', '$logger', '$restore_passthroughs', '$clear', '$split', '$apply_subs', '$==', '$gsub', '$match?', '$compat_mode', '$convert_quoted_text', '$attributes', '$shift', '$store_attribute', '$!=', '$attribute_undefined', '$counter', '$key?', '$downcase', '$attribute_missing', '$info', '$squeeze', '$delete', '$reject', '$start_with?', '$do_replacement', '$extensions', '$inline_macros?', '$inline_macros', '$regexp', '$instance', '$slice', '$length', '$names', '$config', '$merge', '$[]=', '$-', '$normalize_text', '$parse_attributes', '$process_method', '$expand_subs', '$text', '$text=', '$convert', '$class', '$strip', '$>', '$index', '$min', '$compact', '$end_with?', '$map', '$chop', '$new', '$pop', '$rstrip', '$register', '$tr', '$basename', '$parse', '$lstrip', '$split_simple_csv', '$partition', '$extract_attributes_from_text', '$sub', '$encode_uri_component', '$style', '$extname?', '$rindex', '$info?', '$catalog', '$fetch', '$outfilesuffix', '$natural_xrefs', '$resolve_id', '$find', '$footnotes', '$id', '$<', '$size', '$<<', '$attr?', '$attr', '$to_s', '$read_next_id', '$callouts', '$syntax_highlighter', '$highlight?', '$sub_source', '$extract_callouts', '$name', '$to_sym', '$to_i', '$resolve_lines_to_highlight', '$highlight', '$nil_or_empty?', '$restore_callouts', '$count', '$to_a', '$|', '$sort', '$*', '$parse_quoted_text_attributes', '$resolve_pass_subs', '$extract_inner_passthrough', '$basebackend?', '$error', '$chr', '$drop', '$&', '$resolve_subs', '$resolve_block_subs', '$parse_into', '$private', '$=~', '$shorthand_property_syntax', '$each_char']);
3246
+ Opal.add_stubs(['$freeze', '$+', '$keys', '$empty?', '$!', '$===', '$[]', '$join', '$include?', '$extract_passthroughs', '$each', '$sub_specialchars', '$sub_quotes', '$sub_attributes', '$sub_replacements', '$sub_macros', '$highlight_source', '$sub_callouts', '$sub_post_replacements', '$warn', '$logger', '$restore_passthroughs', '$clear', '$split', '$apply_subs', '$==', '$gsub', '$match?', '$compat_mode', '$convert_quoted_text', '$attributes', '$shift', '$store_attribute', '$!=', '$attribute_undefined', '$counter', '$key?', '$downcase', '$attribute_missing', '$info', '$squeeze', '$delete', '$reject', '$start_with?', '$do_replacement', '$extensions', '$inline_macros?', '$inline_macros', '$regexp', '$instance', '$slice', '$length', '$names', '$config', '$merge', '$[]=', '$-', '$normalize_text', '$parse_attributes', '$process_method', '$expand_subs', '$text', '$text=', '$convert', '$class', '$strip', '$>', '$index', '$min', '$compact', '$end_with?', '$map', '$chop', '$new', '$pop', '$rstrip', '$register', '$tr', '$basename', '$parse', '$<<', '$lstrip', '$split_simple_csv', '$partition', '$sub', '$extract_attributes_from_text', '$encode_uri_component', '$style', '$extname?', '$rindex', '$info?', '$catalog', '$fetch', '$outfilesuffix', '$natural_xrefs', '$resolve_id', '$find', '$footnotes', '$id', '$<', '$size', '$attr?', '$attr', '$to_s', '$read_next_id', '$callouts', '$syntax_highlighter', '$highlight?', '$sub_source', '$extract_callouts', '$name', '$to_sym', '$to_i', '$resolve_lines_to_highlight', '$highlight', '$nil_or_empty?', '$restore_callouts', '$count', '$to_a', '$|', '$sort', '$*', '$parse_quoted_text_attributes', '$resolve_pass_subs', '$basebackend?', '$error', '$chr', '$drop', '$&', '$resolve_subs', '$resolve_block_subs', '$parse_into', '$private', '$shorthand_property_syntax', '$each_char']);
3201
3247
  return (function($base, $parent_nesting) {
3202
3248
  var self = $module($base, 'Asciidoctor');
3203
3249
 
@@ -3206,7 +3252,7 @@ Opal.modules["asciidoctor/substitutors"] = function(Opal) {
3206
3252
  (function($base, $parent_nesting) {
3207
3253
  var self = $module($base, 'Substitutors');
3208
3254
 
3209
- var $nesting = [self].concat($parent_nesting), $Substitutors_apply_subs$1, $Substitutors_apply_normal_subs$3, $Substitutors_apply_header_subs$4, $Substitutors_apply_reftext_subs$5, $Substitutors_sub_specialchars$6, $Substitutors_sub_quotes$7, $Substitutors_sub_attributes$10, $Substitutors_sub_replacements$16, $Substitutors_sub_macros$19, $Substitutors_sub_post_replacements$42, $Substitutors_sub_source$45, $Substitutors_sub_callouts$46, $Substitutors_highlight_source$48, $Substitutors_resolve_lines_to_highlight$49, $Substitutors_extract_passthroughs$52, $Substitutors_restore_passthroughs$56, $Substitutors_resolve_subs$58, $Substitutors_resolve_block_subs$60, $Substitutors_resolve_pass_subs$61, $Substitutors_expand_subs$62, $Substitutors_commit_subs$64, $Substitutors_parse_attributes$65, $Substitutors_extract_attributes_from_text$66, $Substitutors_extract_callouts$67, $Substitutors_restore_callouts$70, $Substitutors_extract_inner_passthrough$73, $Substitutors_convert_quoted_text$74, $Substitutors_do_replacement$75, $Substitutors_parse_quoted_text_attributes$76, $Substitutors_normalize_text$77, $Substitutors_split_simple_csv$78;
3255
+ var $nesting = [self].concat($parent_nesting), $Substitutors_apply_subs$1, $Substitutors_apply_normal_subs$3, $Substitutors_apply_header_subs$4, $Substitutors_apply_reftext_subs$5, $Substitutors_sub_specialchars$6, $Substitutors_sub_quotes$7, $Substitutors_sub_attributes$10, $Substitutors_sub_replacements$16, $Substitutors_sub_macros$19, $Substitutors_sub_post_replacements$42, $Substitutors_sub_source$45, $Substitutors_sub_callouts$46, $Substitutors_highlight_source$48, $Substitutors_resolve_lines_to_highlight$49, $Substitutors_extract_passthroughs$52, $Substitutors_restore_passthroughs$56, $Substitutors_resolve_subs$58, $Substitutors_resolve_block_subs$60, $Substitutors_resolve_pass_subs$61, $Substitutors_expand_subs$62, $Substitutors_commit_subs$64, $Substitutors_parse_attributes$65, $Substitutors_extract_attributes_from_text$66, $Substitutors_extract_callouts$67, $Substitutors_restore_callouts$70, $Substitutors_convert_quoted_text$73, $Substitutors_do_replacement$74, $Substitutors_parse_quoted_text_attributes$75, $Substitutors_normalize_text$76, $Substitutors_split_simple_csv$77;
3210
3256
 
3211
3257
 
3212
3258
  Opal.const_set($nesting[0], 'SpecialCharsRx', /[<&>]/);
@@ -3702,7 +3748,7 @@ Opal.modules["asciidoctor/substitutors"] = function(Opal) {
3702
3748
  ($truthy($c = attrs['$[]']("alt")) ? $c : (($writer = ["alt", (($writer = ["default-alt", $$($nesting, 'Helpers').$basename(target, true).$tr("_-", " ")]), $send(attrs, '[]=', Opal.to_a($writer)), $writer[$rb_minus($writer["length"], 1)])]), $send(attrs, '[]=', Opal.to_a($writer)), $writer[$rb_minus($writer["length"], 1)]));
3703
3749
  return $$($nesting, 'Inline').$new(self, "image", nil, $hash2(["type", "target", "attributes"], {"type": type, "target": target, "attributes": attrs})).$convert();}, $$30.$$s = self, $$30.$$arity = 0, $$30))};
3704
3750
  if ($truthy(($truthy($a = ($truthy($b = text['$include?']("((")) ? text['$include?']("))") : $b)) ? $a : ($truthy($b = found_macroish_short) ? text['$include?']("dexterm") : $b)))) {
3705
- text = $send(text, 'gsub', [$$($nesting, 'InlineIndextermMacroRx')], ($$31 = function(){var self = $$31.$$s || this, $c, $$32, $d, $$33, $case = nil, attrlist = nil, primary = nil, attrs = nil, $writer = nil, see_also = nil, term = nil, encl_text = nil, visible = nil, before = nil, after = nil, _ = nil, see = nil, subbed_term = nil, terms = nil;
3751
+ text = $send(text, 'gsub', [$$($nesting, 'InlineIndextermMacroRx')], ($$31 = function(){var self = $$31.$$s || this, $c, $$32, $d, $$33, $case = nil, attrlist = nil, primary = nil, attrs = nil, terms = nil, secondary = nil, tertiary = nil, $writer = nil, see_also = nil, term = nil, encl_text = nil, visible = nil, before = nil, after = nil, _ = nil, see = nil, subbed_term = nil;
3706
3752
 
3707
3753
  return (function() {$case = (($c = $gvars['~']) === nil ? nil : $c['$[]'](1));
3708
3754
  if ("indexterm"['$===']($case)) {
@@ -3711,8 +3757,14 @@ Opal.modules["asciidoctor/substitutors"] = function(Opal) {
3711
3757
  if ($truthy((attrlist = self.$normalize_text((($c = $gvars['~']) === nil ? nil : $c['$[]'](2)), true, true))['$include?']("="))) {
3712
3758
  if ($truthy((primary = (attrs = $$($nesting, 'AttributeList').$new(attrlist, self).$parse())['$[]'](1)))) {
3713
3759
 
3760
+ terms = [primary];
3761
+ if ($truthy((secondary = attrs['$[]'](2)))) {
3762
+
3763
+ terms['$<<'](secondary);
3764
+ if ($truthy((tertiary = attrs['$[]'](3)))) {
3765
+ terms['$<<'](tertiary)};};
3714
3766
 
3715
- $writer = ["terms", [primary]];
3767
+ $writer = ["terms", terms];
3716
3768
  $send(attrs, '[]=', Opal.to_a($writer));
3717
3769
  $writer[$rb_minus($writer["length"], 1)];;
3718
3770
  if ($truthy((see_also = attrs['$[]']("see-also")))) {
@@ -3825,78 +3877,94 @@ Opal.modules["asciidoctor/substitutors"] = function(Opal) {
3825
3877
  return subbed_term
3826
3878
  };}})()}, $$31.$$s = self, $$31.$$arity = 0, $$31))};
3827
3879
  if ($truthy(($truthy($a = found_colon) ? text['$include?']("://") : $a))) {
3828
- text = $send(text, 'gsub', [$$($nesting, 'InlineLinkRx')], ($$34 = function(){var self = $$34.$$s || this, $c, $d, target = nil, prefix = nil, suffix = nil, link_text = nil, $case = nil, attrs = nil, link_opts = nil, new_link_text = nil, $writer = nil, bare = nil;
3880
+ text = $send(text, 'gsub', [$$($nesting, 'InlineLinkRx')], ($$34 = function(){var self = $$34.$$s || this, $c, $d, $e, target = nil, link_text = nil, prefix = nil, suffix = nil, $case = nil, link_opts = nil, new_link_text = nil, attrs = nil, $writer = nil, bare = nil;
3829
3881
 
3830
-
3831
- if ($truthy((target = (($c = $gvars['~']) === nil ? nil : $c['$[]'](2)))['$start_with?']($$($nesting, 'RS')))) {
3832
- return "" + ((($c = $gvars['~']) === nil ? nil : $c['$[]'](1))) + (target.$slice(1, target.$length())) + ((($c = $gvars['~']) === nil ? nil : $c['$[]'](4)));};
3833
- $c = [(($d = $gvars['~']) === nil ? nil : $d['$[]'](1)), ""], (prefix = $c[0]), (suffix = $c[1]), $c;
3834
- if ($truthy((($c = $gvars['~']) === nil ? nil : $c['$[]'](4)))) {
3882
+ if ($truthy(($truthy($c = (($d = $gvars['~']) === nil ? nil : $d['$[]'](2))) ? (($d = $gvars['~']) === nil ? nil : $d['$[]'](5))['$!']() : $c))) {
3835
3883
 
3836
- if (prefix['$==']("link:")) {
3837
- prefix = ""};
3838
- if ($truthy((link_text = (($c = $gvars['~']) === nil ? nil : $c['$[]'](4)))['$empty?']())) {
3839
- link_text = nil};
3840
- } else {
3841
-
3842
- $case = prefix;
3843
- if ("link:"['$===']($case) || "\""['$===']($case) || "'"['$===']($case)) {return (($c = $gvars['~']) === nil ? nil : $c['$[]'](0));};
3844
- $case = (($c = $gvars['~']) === nil ? nil : $c['$[]'](3));
3845
- if (")"['$===']($case) || "?"['$===']($case) || "!"['$===']($case)) {
3846
- target = target.$chop();
3847
- if ($truthy((($c = (suffix = (($d = $gvars['~']) === nil ? nil : $d['$[]'](3)))['$=='](")")) ? target['$end_with?'](".", "?", "!") : (suffix = (($d = $gvars['~']) === nil ? nil : $d['$[]'](3)))['$=='](")")))) {
3848
-
3849
- suffix = $rb_plus(target['$[]'](-1), suffix);
3850
- target = target.$chop();};
3851
- if ($truthy(target['$end_with?']("://"))) {
3852
- return (($c = $gvars['~']) === nil ? nil : $c['$[]'](0));};}
3853
- else if (";"['$===']($case)) {
3854
- if ($truthy(($truthy($c = prefix['$start_with?']("&lt;")) ? target['$end_with?']("&gt;") : $c))) {
3855
-
3856
- prefix = prefix.$slice(4, prefix.$length());
3857
- target = target.$slice(0, $rb_minus(target.$length(), 4));
3858
- } else if ($truthy((target = target.$chop())['$end_with?'](")"))) {
3859
-
3860
- target = target.$chop();
3861
- suffix = ");";
3884
+ if ($truthy((($c = $gvars['~']) === nil ? nil : $c['$[]'](1))['$start_with?']($$($nesting, 'RS')))) {
3885
+ return (($c = $gvars['~']) === nil ? nil : $c['$[]'](0)).$slice(1, (($c = $gvars['~']) === nil ? nil : $c['$[]'](0)).$length());};
3886
+ if ($truthy((($c = $gvars['~']) === nil ? nil : $c['$[]'](3))['$start_with?']($$($nesting, 'RS')))) {
3887
+ return "" + ((($c = $gvars['~']) === nil ? nil : $c['$[]'](1))) + ((($c = $gvars['~']) === nil ? nil : $c['$[]'](0)).$slice($rb_plus((($c = $gvars['~']) === nil ? nil : $c['$[]'](1)).$length(), 1), (($c = $gvars['~']) === nil ? nil : $c['$[]'](0)).$length()));};
3888
+ if ($truthy((($c = $gvars['~']) === nil ? nil : $c['$[]'](6)))) {
3862
3889
  } else {
3863
- suffix = ";"
3890
+ return (($c = $gvars['~']) === nil ? nil : $c['$[]'](0));
3864
3891
  };
3865
- if ($truthy(target['$end_with?']("://"))) {
3866
- return (($c = $gvars['~']) === nil ? nil : $c['$[]'](0));};}
3867
- else if (":"['$===']($case)) {
3868
- if ($truthy((target = target.$chop())['$end_with?'](")"))) {
3892
+ doc.$register("links", (target = $rb_plus((($c = $gvars['~']) === nil ? nil : $c['$[]'](3)), (($c = $gvars['~']) === nil ? nil : $c['$[]'](6)))));
3893
+ link_text = (function() {if ($truthy(doc_attrs['$key?']("hide-uri-scheme"))) {
3869
3894
 
3870
- target = target.$chop();
3871
- suffix = "):";
3895
+ return target.$sub($$($nesting, 'UriSniffRx'), "");
3872
3896
  } else {
3873
- suffix = ":"
3874
- };
3875
- if ($truthy(target['$end_with?']("://"))) {
3876
- return (($c = $gvars['~']) === nil ? nil : $c['$[]'](0));};};
3877
- };
3878
- $c = [nil, $hash2(["type"], {"type": "link"})], (attrs = $c[0]), (link_opts = $c[1]), $c;
3879
- if ($truthy(link_text)) {
3897
+ return target
3898
+ }; return nil; })();
3899
+ return $$($nesting, 'Inline').$new(self, "anchor", link_text, $hash2(["type", "target", "attributes"], {"type": "link", "target": target, "attributes": $hash2(["role"], {"role": "bare"})})).$convert();
3900
+ } else {
3880
3901
 
3881
- if ($truthy(link_text['$include?']($$($nesting, 'R_SB')))) {
3882
- new_link_text = (link_text = link_text.$gsub($$($nesting, 'ESC_R_SB'), $$($nesting, 'R_SB')))};
3883
- if ($truthy(($truthy($c = doc.$compat_mode()['$!']()) ? link_text['$include?']("=") : $c))) {
3884
-
3885
- $d = self.$extract_attributes_from_text(link_text, ""), $c = Opal.to_ary($d), (link_text = ($c[0] == null ? nil : $c[0])), (attrs = ($c[1] == null ? nil : $c[1])), $d;
3886
- new_link_text = link_text;
3902
+ if ($truthy((($c = $gvars['~']) === nil ? nil : $c['$[]'](3))['$start_with?']($$($nesting, 'RS')))) {
3903
+ return "" + ((($c = $gvars['~']) === nil ? nil : $c['$[]'](1))) + ((($c = $gvars['~']) === nil ? nil : $c['$[]'](0)).$slice($rb_plus((($c = $gvars['~']) === nil ? nil : $c['$[]'](1)).$length(), 1), (($c = $gvars['~']) === nil ? nil : $c['$[]'](0)).$length()));};
3904
+ $c = [(($d = $gvars['~']) === nil ? nil : $d['$[]'](1)), $rb_plus((($d = $gvars['~']) === nil ? nil : $d['$[]'](3)), ($truthy($d = (($e = $gvars['~']) === nil ? nil : $e['$[]'](4))) ? $d : (($e = $gvars['~']) === nil ? nil : $e['$[]'](7)))), ""], (prefix = $c[0]), (target = $c[1]), (suffix = $c[2]), $c;
3905
+ if ($truthy((($c = $gvars['~']) === nil ? nil : $c['$[]'](5)))) {
3887
3906
 
3888
- $writer = ["id", attrs['$[]']("id")];
3889
- $send(link_opts, '[]=', Opal.to_a($writer));
3890
- $writer[$rb_minus($writer["length"], 1)];;};
3891
- if ($truthy(link_text['$end_with?']("^"))) {
3907
+ if (prefix['$==']("link:")) {
3908
+ prefix = ""};
3909
+ if ($truthy((link_text = (($c = $gvars['~']) === nil ? nil : $c['$[]'](5)))['$empty?']())) {
3910
+ link_text = nil};
3911
+ } else {
3892
3912
 
3893
- new_link_text = (link_text = link_text.$chop());
3894
- if ($truthy(attrs)) {
3895
- ($truthy($c = attrs['$[]']("window")) ? $c : (($writer = ["window", "_blank"]), $send(attrs, '[]=', Opal.to_a($writer)), $writer[$rb_minus($writer["length"], 1)]))
3913
+ $case = prefix;
3914
+ if ("link:"['$===']($case) || "\""['$===']($case) || "'"['$===']($case)) {return (($c = $gvars['~']) === nil ? nil : $c['$[]'](0));};
3915
+ $case = (($c = $gvars['~']) === nil ? nil : $c['$[]'](8));
3916
+ if (";"['$===']($case)) {
3917
+ if ($truthy((target = target.$chop())['$end_with?'](")"))) {
3918
+
3919
+ target = target.$chop();
3920
+ suffix = ");";
3896
3921
  } else {
3897
- attrs = $hash2(["window"], {"window": "_blank"})
3898
- };};
3899
- if ($truthy(($truthy($c = new_link_text) ? new_link_text['$empty?']() : $c))) {
3922
+ suffix = ";"
3923
+ };
3924
+ if (target['$==']((($c = $gvars['~']) === nil ? nil : $c['$[]'](3)))) {
3925
+ return (($c = $gvars['~']) === nil ? nil : $c['$[]'](0));};}
3926
+ else if (":"['$===']($case)) {
3927
+ if ($truthy((target = target.$chop())['$end_with?'](")"))) {
3928
+
3929
+ target = target.$chop();
3930
+ suffix = "):";
3931
+ } else {
3932
+ suffix = ":"
3933
+ };
3934
+ if (target['$==']((($c = $gvars['~']) === nil ? nil : $c['$[]'](3)))) {
3935
+ return (($c = $gvars['~']) === nil ? nil : $c['$[]'](0));};};
3936
+ };
3937
+ link_opts = $hash2(["type"], {"type": "link"});
3938
+ if ($truthy(link_text)) {
3939
+
3940
+ if ($truthy(link_text['$include?']($$($nesting, 'R_SB')))) {
3941
+ new_link_text = (link_text = link_text.$gsub($$($nesting, 'ESC_R_SB'), $$($nesting, 'R_SB')))};
3942
+ if ($truthy(($truthy($c = doc.$compat_mode()['$!']()) ? link_text['$include?']("=") : $c))) {
3943
+
3944
+ $d = self.$extract_attributes_from_text(link_text, ""), $c = Opal.to_ary($d), (link_text = ($c[0] == null ? nil : $c[0])), (attrs = ($c[1] == null ? nil : $c[1])), $d;
3945
+ new_link_text = link_text;
3946
+
3947
+ $writer = ["id", attrs['$[]']("id")];
3948
+ $send(link_opts, '[]=', Opal.to_a($writer));
3949
+ $writer[$rb_minus($writer["length"], 1)];;};
3950
+ if ($truthy(link_text['$end_with?']("^"))) {
3951
+
3952
+ new_link_text = (link_text = link_text.$chop());
3953
+ if ($truthy(attrs)) {
3954
+ ($truthy($c = attrs['$[]']("window")) ? $c : (($writer = ["window", "_blank"]), $send(attrs, '[]=', Opal.to_a($writer)), $writer[$rb_minus($writer["length"], 1)]))
3955
+ } else {
3956
+ attrs = $hash2(["window"], {"window": "_blank"})
3957
+ };};
3958
+ if ($truthy(($truthy($c = new_link_text) ? new_link_text['$empty?']() : $c))) {
3959
+
3960
+ link_text = (function() {if ($truthy(doc_attrs['$key?']("hide-uri-scheme"))) {
3961
+
3962
+ return target.$sub($$($nesting, 'UriSniffRx'), "");
3963
+ } else {
3964
+ return target
3965
+ }; return nil; })();
3966
+ bare = true;};
3967
+ } else {
3900
3968
 
3901
3969
  link_text = (function() {if ($truthy(doc_attrs['$key?']("hide-uri-scheme"))) {
3902
3970
 
@@ -3904,37 +3972,29 @@ Opal.modules["asciidoctor/substitutors"] = function(Opal) {
3904
3972
  } else {
3905
3973
  return target
3906
3974
  }; return nil; })();
3907
- bare = true;};
3908
- } else {
3909
-
3910
- link_text = (function() {if ($truthy(doc_attrs['$key?']("hide-uri-scheme"))) {
3911
-
3912
- return target.$sub($$($nesting, 'UriSniffRx'), "");
3913
- } else {
3914
- return target
3915
- }; return nil; })();
3916
- bare = true;
3917
- };
3918
- if ($truthy(bare)) {
3975
+ bare = true;
3976
+ };
3977
+ if ($truthy(bare)) {
3978
+ if ($truthy(attrs)) {
3979
+
3980
+ $writer = ["role", (function() {if ($truthy(attrs['$key?']("role"))) {
3981
+ return "" + "bare " + (attrs['$[]']("role"))
3982
+ } else {
3983
+ return "bare"
3984
+ }; return nil; })()];
3985
+ $send(attrs, '[]=', Opal.to_a($writer));
3986
+ $writer[$rb_minus($writer["length"], 1)];
3987
+ } else {
3988
+ attrs = $hash2(["role"], {"role": "bare"})
3989
+ }};
3990
+ doc.$register("links", (($writer = ["target", target]), $send(link_opts, '[]=', Opal.to_a($writer)), $writer[$rb_minus($writer["length"], 1)]));
3919
3991
  if ($truthy(attrs)) {
3920
3992
 
3921
- $writer = ["role", (function() {if ($truthy(attrs['$key?']("role"))) {
3922
- return "" + "bare " + (attrs['$[]']("role"))
3923
- } else {
3924
- return "bare"
3925
- }; return nil; })()];
3926
- $send(attrs, '[]=', Opal.to_a($writer));
3927
- $writer[$rb_minus($writer["length"], 1)];
3928
- } else {
3929
- attrs = $hash2(["role"], {"role": "bare"})
3930
- }};
3931
- doc.$register("links", (($writer = ["target", target]), $send(link_opts, '[]=', Opal.to_a($writer)), $writer[$rb_minus($writer["length"], 1)]));
3932
- if ($truthy(attrs)) {
3933
-
3934
- $writer = ["attributes", attrs];
3935
- $send(link_opts, '[]=', Opal.to_a($writer));
3936
- $writer[$rb_minus($writer["length"], 1)];};
3937
- return "" + (prefix) + ($$($nesting, 'Inline').$new(self, "anchor", link_text, link_opts).$convert()) + (suffix);}, $$34.$$s = self, $$34.$$arity = 0, $$34))};
3993
+ $writer = ["attributes", attrs];
3994
+ $send(link_opts, '[]=', Opal.to_a($writer));
3995
+ $writer[$rb_minus($writer["length"], 1)];};
3996
+ return "" + (prefix) + ($$($nesting, 'Inline').$new(self, "anchor", link_text, link_opts).$convert()) + (suffix);
3997
+ }}, $$34.$$s = self, $$34.$$arity = 0, $$34))};
3938
3998
  if ($truthy(($truthy($a = found_macroish) ? ($truthy($b = text['$include?']("link:")) ? $b : text['$include?']("ilto:")) : $a))) {
3939
3999
  text = $send(text, 'gsub', [$$($nesting, 'InlineLinkMacroRx')], ($$35 = function(){var self = $$35.$$s || this, $c, $d, mailto = nil, target = nil, mailto_text = nil, attrs = nil, link_opts = nil, link_text = nil, $writer = nil;
3940
4000
 
@@ -4072,7 +4132,7 @@ Opal.modules["asciidoctor/substitutors"] = function(Opal) {
4072
4132
  };
4073
4133
  if ($truthy(doc.$compat_mode())) {
4074
4134
  fragment = refid
4075
- } else if ($truthy((hash_idx = refid.$index("#")))) {
4135
+ } else if ($truthy(($truthy($c = (hash_idx = refid.$index("#"))) ? refid['$[]']($rb_minus(hash_idx, 1))['$!=']("&") : $c))) {
4076
4136
  if ($truthy($rb_gt(hash_idx, 0))) {
4077
4137
 
4078
4138
  if ($truthy($rb_gt((fragment_len = $rb_minus($rb_minus(refid.$length(), 1), hash_idx)), 0))) {
@@ -4423,13 +4483,20 @@ Opal.modules["asciidoctor/substitutors"] = function(Opal) {
4423
4483
  return "" + ((($c = $gvars['~']) === nil ? nil : $c['$[]'](1))) + "[" + (attrlist) + "]" + ($rb_times($$($nesting, 'RS'), $rb_minus(escape_count, 1))) + (boundary) + ((($c = $gvars['~']) === nil ? nil : $c['$[]'](5))) + (boundary);
4424
4484
  } else if ((($c = $gvars['~']) === nil ? nil : $c['$[]'](1))['$==']($$($nesting, 'RS'))) {
4425
4485
  preceding = "" + "[" + (attrlist) + "]"
4426
- } else {
4427
-
4428
- if ($truthy((($c = boundary['$==']("++")) ? attrlist['$end_with?']("x-") : boundary['$==']("++")))) {
4486
+ } else if (boundary['$==']("++")) {
4487
+ if (attrlist['$==']("x-")) {
4429
4488
 
4430
4489
  old_behavior = true;
4431
- attrlist = attrlist.$slice(0, $rb_minus(attrlist.$length(), 2));};
4432
- attributes = self.$parse_quoted_text_attributes(attrlist);
4490
+ attributes = $hash2([], {});
4491
+ } else if ($truthy(attrlist['$end_with?'](" x-"))) {
4492
+
4493
+ old_behavior = true;
4494
+ attributes = self.$parse_quoted_text_attributes(attrlist.$slice(0, $rb_minus(attrlist.$length(), 3)));
4495
+ } else {
4496
+ attributes = self.$parse_quoted_text_attributes(attrlist)
4497
+ }
4498
+ } else {
4499
+ attributes = self.$parse_quoted_text_attributes(attrlist)
4433
4500
  }
4434
4501
  } else if ($truthy($rb_gt((escape_count = (($c = $gvars['~']) === nil ? nil : $c['$[]'](3)).$length()), 0))) {
4435
4502
  return "" + ($rb_times($$($nesting, 'RS'), $rb_minus(escape_count, 1))) + (boundary) + ((($c = $gvars['~']) === nil ? nil : $c['$[]'](5))) + (boundary);};
@@ -4475,33 +4542,42 @@ Opal.modules["asciidoctor/substitutors"] = function(Opal) {
4475
4542
  return "" + (($truthy($c = preceding) ? $c : "")) + ($$($nesting, 'PASS_START')) + (passthru_key) + ($$($nesting, 'PASS_END'));}, $$53.$$s = self, $$53.$$arity = 0, $$53))};
4476
4543
  $b = $$($nesting, 'InlinePassRx')['$[]'](compat_mode), $a = Opal.to_ary($b), (pass_inline_char1 = ($a[0] == null ? nil : $a[0])), (pass_inline_char2 = ($a[1] == null ? nil : $a[1])), (pass_inline_rx = ($a[2] == null ? nil : $a[2])), $b;
4477
4544
  if ($truthy(($truthy($a = text['$include?'](pass_inline_char1)) ? $a : ($truthy($b = pass_inline_char2) ? text['$include?'](pass_inline_char2) : $b)))) {
4478
- text = $send(text, 'gsub', [pass_inline_rx], ($$54 = function(){var self = $$54.$$s || this, $c, preceding = nil, attrlist = nil, quoted_text = nil, escape_mark = nil, format_mark = nil, content = nil, old_behavior = nil, attributes = nil, $writer = nil, passthru_key = nil, subs = nil;
4545
+ text = $send(text, 'gsub', [pass_inline_rx], ($$54 = function(){var self = $$54.$$s || this, $c, $d, preceding = nil, attrlist = nil, escaped = nil, quoted_text = nil, format_mark = nil, content = nil, old_behavior = nil, old_behavior_forced = nil, attributes = nil, $writer = nil, passthru_key = nil, subs = nil;
4479
4546
 
4480
4547
 
4481
4548
  preceding = (($c = $gvars['~']) === nil ? nil : $c['$[]'](1));
4482
- attrlist = (($c = $gvars['~']) === nil ? nil : $c['$[]'](2));
4483
- if ($truthy((quoted_text = (($c = $gvars['~']) === nil ? nil : $c['$[]'](3)))['$start_with?']($$($nesting, 'RS')))) {
4484
- escape_mark = $$($nesting, 'RS')};
4485
- format_mark = (($c = $gvars['~']) === nil ? nil : $c['$[]'](4));
4486
- content = (($c = $gvars['~']) === nil ? nil : $c['$[]'](5));
4549
+ attrlist = ($truthy($c = (($d = $gvars['~']) === nil ? nil : $d['$[]'](4))) ? $c : (($d = $gvars['~']) === nil ? nil : $d['$[]'](3)));
4550
+ if ($truthy((($c = $gvars['~']) === nil ? nil : $c['$[]'](5)))) {
4551
+ escaped = true};
4552
+ quoted_text = (($c = $gvars['~']) === nil ? nil : $c['$[]'](6));
4553
+ format_mark = (($c = $gvars['~']) === nil ? nil : $c['$[]'](7));
4554
+ content = (($c = $gvars['~']) === nil ? nil : $c['$[]'](8));
4487
4555
  if ($truthy(compat_mode)) {
4488
4556
  old_behavior = true
4489
- } else if ($truthy((old_behavior = ($truthy($c = attrlist) ? attrlist['$end_with?']("x-") : $c)))) {
4490
- attrlist = attrlist.$slice(0, $rb_minus(attrlist.$length(), 2))};
4557
+ } else if ($truthy(($truthy($c = attrlist) ? ($truthy($d = attrlist['$==']("x-")) ? $d : attrlist['$end_with?'](" x-")) : $c))) {
4558
+ old_behavior = (old_behavior_forced = true)};
4491
4559
  if ($truthy(attrlist)) {
4492
- if ($truthy((($c = format_mark['$==']("`")) ? old_behavior['$!']() : format_mark['$==']("`")))) {
4493
- return self.$extract_inner_passthrough(content, "" + (preceding) + "[" + (attrlist) + "]" + (escape_mark));
4494
- } else if ($truthy(escape_mark)) {
4560
+ if ($truthy(escaped)) {
4495
4561
  return "" + (preceding) + "[" + (attrlist) + "]" + (quoted_text.$slice(1, quoted_text.$length()));
4496
4562
  } else if (preceding['$==']($$($nesting, 'RS'))) {
4497
- preceding = "" + "[" + (attrlist) + "]"
4563
+
4564
+ if ($truthy(($truthy($c = old_behavior_forced) ? format_mark['$==']("`") : $c))) {
4565
+ return "" + (preceding) + "[" + (attrlist) + "]" + (quoted_text);};
4566
+ preceding = "" + "[" + (attrlist) + "]";
4567
+ } else if ($truthy(old_behavior_forced)) {
4568
+ attributes = (function() {if (attrlist['$==']("x-")) {
4569
+ return $hash2([], {})
4570
+ } else {
4571
+
4572
+ return self.$parse_quoted_text_attributes(attrlist.$slice(0, $rb_minus(attrlist.$length(), 3)));
4573
+ }; return nil; })()
4498
4574
  } else {
4499
4575
  attributes = self.$parse_quoted_text_attributes(attrlist)
4500
4576
  }
4501
- } else if ($truthy((($c = format_mark['$==']("`")) ? old_behavior['$!']() : format_mark['$==']("`")))) {
4502
- return self.$extract_inner_passthrough(content, "" + (preceding) + (escape_mark));
4503
- } else if ($truthy(escape_mark)) {
4504
- return "" + (preceding) + (quoted_text.$slice(1, quoted_text.$length()));};
4577
+ } else if ($truthy(escaped)) {
4578
+ return "" + (preceding) + (quoted_text.$slice(1, quoted_text.$length()));
4579
+ } else if ($truthy(($truthy($c = compat_mode) ? preceding['$==']($$($nesting, 'RS')) : $c))) {
4580
+ return quoted_text;};
4505
4581
  if ($truthy(compat_mode)) {
4506
4582
 
4507
4583
  $writer = [(passthru_key = passthrus.$size()), $hash2(["text", "subs", "attributes", "type"], {"text": content, "subs": $$($nesting, 'BASIC_SUBS'), "attributes": attributes, "type": "monospaced"})];
@@ -4935,27 +5011,7 @@ Opal.modules["asciidoctor/substitutors"] = function(Opal) {
4935
5011
  };}, $$71.$$s = self, $$71.$$arity = 1, $$71)).$join($$($nesting, 'LF')));
4936
5012
  }, $Substitutors_restore_callouts$70.$$arity = -3);
4937
5013
 
4938
- Opal.def(self, '$extract_inner_passthrough', $Substitutors_extract_inner_passthrough$73 = function $$extract_inner_passthrough(text, pre) {
4939
- var $a, $b, self = this, $writer = nil, passthru_key = nil;
4940
- if (self.passthroughs == null) self.passthroughs = nil;
4941
-
4942
- if ($truthy(($truthy($a = ($truthy($b = text['$end_with?']("+")) ? text['$start_with?']("+", "\\+") : $b)) ? $$($nesting, 'SinglePlusInlinePassRx')['$=~'](text) : $a))) {
4943
- if ($truthy((($a = $gvars['~']) === nil ? nil : $a['$[]'](1)))) {
4944
- return "" + (pre) + "`+" + ((($a = $gvars['~']) === nil ? nil : $a['$[]'](2))) + "+`"
4945
- } else {
4946
-
4947
-
4948
- $writer = [(passthru_key = self.passthroughs.$size()), $hash2(["text", "subs"], {"text": (($a = $gvars['~']) === nil ? nil : $a['$[]'](2)), "subs": $$($nesting, 'BASIC_SUBS')})];
4949
- $send(self.passthroughs, '[]=', Opal.to_a($writer));
4950
- $writer[$rb_minus($writer["length"], 1)];;
4951
- return "" + (pre) + "`" + ($$($nesting, 'PASS_START')) + (passthru_key) + ($$($nesting, 'PASS_END')) + "`";
4952
- }
4953
- } else {
4954
- return "" + (pre) + "`" + (text) + "`"
4955
- }
4956
- }, $Substitutors_extract_inner_passthrough$73.$$arity = 2);
4957
-
4958
- Opal.def(self, '$convert_quoted_text', $Substitutors_convert_quoted_text$74 = function $$convert_quoted_text(match, type, scope) {
5014
+ Opal.def(self, '$convert_quoted_text', $Substitutors_convert_quoted_text$73 = function $$convert_quoted_text(match, type, scope) {
4959
5015
  var $a, self = this, attrs = nil, unescaped_attrs = nil, attrlist = nil, id = nil, attributes = nil;
4960
5016
 
4961
5017
 
@@ -4986,9 +5042,9 @@ Opal.modules["asciidoctor/substitutors"] = function(Opal) {
4986
5042
  type = "unquoted"};};
4987
5043
  return $$($nesting, 'Inline').$new(self, "quoted", match['$[]'](2), $hash2(["type", "id", "attributes"], {"type": type, "id": id, "attributes": attributes})).$convert();
4988
5044
  };
4989
- }, $Substitutors_convert_quoted_text$74.$$arity = 3);
5045
+ }, $Substitutors_convert_quoted_text$73.$$arity = 3);
4990
5046
 
4991
- Opal.def(self, '$do_replacement', $Substitutors_do_replacement$75 = function $$do_replacement(m, replacement, restore) {
5047
+ Opal.def(self, '$do_replacement', $Substitutors_do_replacement$74 = function $$do_replacement(m, replacement, restore) {
4992
5048
  var self = this, captured = nil, $case = nil;
4993
5049
 
4994
5050
  if ($truthy((captured = m['$[]'](0))['$include?']($$($nesting, 'RS')))) {
@@ -4999,13 +5055,13 @@ Opal.modules["asciidoctor/substitutors"] = function(Opal) {
4999
5055
  else if ("bounding"['$===']($case)) {return $rb_plus($rb_plus(m['$[]'](1), replacement), m['$[]'](2))}
5000
5056
  else {return $rb_plus(m['$[]'](1), replacement)}})()
5001
5057
  }
5002
- }, $Substitutors_do_replacement$75.$$arity = 3);
5058
+ }, $Substitutors_do_replacement$74.$$arity = 3);
5003
5059
  if ($$($nesting, 'RUBY_ENGINE')['$==']("opal")) {
5004
5060
  } else {
5005
5061
  nil
5006
5062
  };
5007
5063
 
5008
- Opal.def(self, '$parse_quoted_text_attributes', $Substitutors_parse_quoted_text_attributes$76 = function $$parse_quoted_text_attributes(str) {
5064
+ Opal.def(self, '$parse_quoted_text_attributes', $Substitutors_parse_quoted_text_attributes$75 = function $$parse_quoted_text_attributes(str) {
5009
5065
  var $a, $b, self = this, before = nil, _ = nil, after = nil, attrs = nil, $writer = nil, id = nil, roles = nil;
5010
5066
 
5011
5067
 
@@ -5057,9 +5113,9 @@ Opal.modules["asciidoctor/substitutors"] = function(Opal) {
5057
5113
  } else {
5058
5114
  return $hash2(["role"], {"role": str})
5059
5115
  };
5060
- }, $Substitutors_parse_quoted_text_attributes$76.$$arity = 1);
5116
+ }, $Substitutors_parse_quoted_text_attributes$75.$$arity = 1);
5061
5117
 
5062
- Opal.def(self, '$normalize_text', $Substitutors_normalize_text$77 = function $$normalize_text(text, normalize_whitespace, unescape_closing_square_brackets) {
5118
+ Opal.def(self, '$normalize_text', $Substitutors_normalize_text$76 = function $$normalize_text(text, normalize_whitespace, unescape_closing_square_brackets) {
5063
5119
  var $a, self = this;
5064
5120
 
5065
5121
 
@@ -5080,10 +5136,10 @@ Opal.modules["asciidoctor/substitutors"] = function(Opal) {
5080
5136
  text = text.$gsub($$($nesting, 'ESC_R_SB'), $$($nesting, 'R_SB'))};
5081
5137
  };
5082
5138
  return text;
5083
- }, $Substitutors_normalize_text$77.$$arity = -2);
5139
+ }, $Substitutors_normalize_text$76.$$arity = -2);
5084
5140
 
5085
- Opal.def(self, '$split_simple_csv', $Substitutors_split_simple_csv$78 = function $$split_simple_csv(str) {
5086
- var $$79, $$80, self = this, values = nil, accum = nil, quote_open = nil;
5141
+ Opal.def(self, '$split_simple_csv', $Substitutors_split_simple_csv$77 = function $$split_simple_csv(str) {
5142
+ var $$78, $$79, self = this, values = nil, accum = nil, quote_open = nil;
5087
5143
 
5088
5144
  if ($truthy(str['$empty?']())) {
5089
5145
  return []
@@ -5092,7 +5148,7 @@ Opal.modules["asciidoctor/substitutors"] = function(Opal) {
5092
5148
  values = [];
5093
5149
  accum = "";
5094
5150
  quote_open = nil;
5095
- $send(str, 'each_char', [], ($$79 = function(c){var self = $$79.$$s || this, $case = nil;
5151
+ $send(str, 'each_char', [], ($$78 = function(c){var self = $$78.$$s || this, $case = nil;
5096
5152
 
5097
5153
 
5098
5154
 
@@ -5108,19 +5164,19 @@ Opal.modules["asciidoctor/substitutors"] = function(Opal) {
5108
5164
  return (accum = "");
5109
5165
  }}
5110
5166
  else if ("\""['$===']($case)) {return (quote_open = quote_open['$!']())}
5111
- else {return (accum = $rb_plus(accum, c))}})();}, $$79.$$s = self, $$79.$$arity = 1, $$79));
5167
+ else {return (accum = $rb_plus(accum, c))}})();}, $$78.$$s = self, $$78.$$arity = 1, $$78));
5112
5168
  return values['$<<'](accum.$strip());
5113
5169
  } else {
5114
- return $send(str.$split(","), 'map', [], ($$80 = function(it){var self = $$80.$$s || this;
5170
+ return $send(str.$split(","), 'map', [], ($$79 = function(it){var self = $$79.$$s || this;
5115
5171
 
5116
5172
 
5117
5173
 
5118
5174
  if (it == null) {
5119
5175
  it = nil;
5120
5176
  };
5121
- return it.$strip();}, $$80.$$s = self, $$80.$$arity = 1, $$80))
5177
+ return it.$strip();}, $$79.$$s = self, $$79.$$arity = 1, $$79))
5122
5178
  }
5123
- }, $Substitutors_split_simple_csv$78.$$arity = 1);
5179
+ }, $Substitutors_split_simple_csv$77.$$arity = 1);
5124
5180
  })($nesting[0], $nesting)
5125
5181
  })($nesting[0], $nesting)
5126
5182
  };
@@ -5134,7 +5190,7 @@ Opal.modules["asciidoctor/version"] = function(Opal) {
5134
5190
 
5135
5191
  var $nesting = [self].concat($parent_nesting);
5136
5192
 
5137
- Opal.const_set($nesting[0], 'VERSION', "2.0.17")
5193
+ Opal.const_set($nesting[0], 'VERSION', "2.0.23")
5138
5194
  })($nesting[0], $nesting)
5139
5195
  };
5140
5196
 
@@ -5148,7 +5204,7 @@ Opal.modules["asciidoctor/abstract_node"] = function(Opal) {
5148
5204
  }
5149
5205
  var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2, $truthy = Opal.truthy, $send = Opal.send;
5150
5206
 
5151
- Opal.add_stubs(['$include', '$attr_reader', '$attr_accessor', '$==', '$document', '$to_s', '$[]', '$merge', '$raise', '$converter', '$attributes', '$key?', '$[]=', '$-', '$delete', '$tap', '$new', '$each_key', '$end_with?', '$<<', '$slice', '$length', '$update', '$split', '$include?', '$===', '$join', '$empty?', '$apply_reftext_subs', '$attr?', '$attr', '$extname?', '$image_uri', '$<', '$safe', '$uriish?', '$encode_spaces_in_uri', '$normalize_web_path', '$generate_data_uri_from_uri', '$generate_data_uri', '$extname', '$normalize_system_path', '$readable?', '$strict_encode64', '$binread', '$warn', '$logger', '$require_library', '$!', '$open_uri', '$content_type', '$read', '$base_dir', '$root?', '$path_resolver', '$system_path', '$web_path', '$!=', '$prepare_source_string', '$fetch', '$read_asset']);
5207
+ Opal.add_stubs(['$include', '$attr_reader', '$attr_accessor', '$==', '$document', '$to_s', '$[]', '$merge', '$raise', '$converter', '$attributes', '$key?', '$[]=', '$-', '$delete', '$tap', '$new', '$each_key', '$end_with?', '$<<', '$slice', '$length', '$update', '$split', '$include?', '$===', '$join', '$empty?', '$apply_reftext_subs', '$attr?', '$attr', '$extname?', '$image_uri', '$<', '$safe', '$uriish?', '$encode_spaces_in_uri', '$normalize_web_path', '$generate_data_uri_from_uri', '$generate_data_uri', '$extname', '$normalize_system_path', '$readable?', '$pack', '$binread', '$warn', '$logger', '$require_library', '$!', '$open_uri', '$content_type', '$read', '$base_dir', '$root?', '$path_resolver', '$system_path', '$web_path', '$!=', '$prepare_source_string', '$fetch', '$read_asset']);
5152
5208
  return (function($base, $parent_nesting) {
5153
5209
  var self = $module($base, 'Asciidoctor');
5154
5210
 
@@ -5553,7 +5609,7 @@ Opal.modules["asciidoctor/abstract_node"] = function(Opal) {
5553
5609
  image_path = self.$normalize_system_path(target_image)
5554
5610
  };
5555
5611
  if ($truthy($$$('::', 'File')['$readable?'](image_path))) {
5556
- return "" + "data:" + (mimetype) + ";base64," + ($$$('::', 'Base64').$strict_encode64($$$('::', 'File').$binread(image_path)))
5612
+ return "" + "data:" + (mimetype) + ";base64," + ([$$$('::', 'File').$binread(image_path)].$pack("m0"))
5557
5613
  } else {
5558
5614
 
5559
5615
  self.$logger().$warn("" + "image to embed not found or not readable: " + (image_path));
@@ -5584,7 +5640,7 @@ Opal.modules["asciidoctor/abstract_node"] = function(Opal) {
5584
5640
  f = nil;
5585
5641
  };
5586
5642
  return [f.$content_type(), f.$read()];}, $$30.$$s = self, $$30.$$arity = 1, $$30)), $a = Opal.to_ary($b), (mimetype = ($a[0] == null ? nil : $a[0])), (bindata = ($a[1] == null ? nil : $a[1])), $b;
5587
- return "" + "data:" + (mimetype) + ";base64," + ($$$('::', 'Base64').$strict_encode64(bindata));
5643
+ return "" + "data:" + (mimetype) + ";base64," + ([bindata].$pack("m0"));
5588
5644
  } catch ($err) {
5589
5645
  if (Opal.rescue($err, [$$($nesting, 'StandardError')])) {
5590
5646
  try {
@@ -6712,7 +6768,7 @@ Opal.modules["asciidoctor/block"] = function(Opal) {
6712
6768
  else if ("verbatim"['$===']($case) || "raw"['$===']($case)) {
6713
6769
  result = self.$apply_subs(self.lines, self.subs);
6714
6770
  if ($truthy($rb_lt(result.$size(), 2))) {
6715
- return result['$[]'](0)
6771
+ return ($truthy($a = result['$[]'](0)) ? $a : "")
6716
6772
  } else {
6717
6773
 
6718
6774
  while ($truthy(($truthy($b = (first = result['$[]'](0))) ? first.$rstrip()['$empty?']() : $b))) {
@@ -6726,7 +6782,7 @@ Opal.modules["asciidoctor/block"] = function(Opal) {
6726
6782
  else {
6727
6783
  if (self.content_model['$==']("empty")) {
6728
6784
  } else {
6729
- self.$logger().$warn("" + "Unknown content model '" + (self.content_model) + "' for block: " + (self))
6785
+ self.$logger().$warn("" + "unknown content model '" + (self.content_model) + "' for block: " + (self))
6730
6786
  };
6731
6787
  return nil;}})()
6732
6788
  }, $Block_content$2.$$arity = 0);
@@ -7568,6 +7624,11 @@ Opal.modules["asciidoctor/document"] = function(Opal) {
7568
7624
  $writer = ["catalog_assets", true];
7569
7625
  $send(options, '[]=', Opal.to_a($writer));
7570
7626
  $writer[$rb_minus($writer["length"], 1)];};
7627
+ if ($truthy(parent_doc.$options()['$[]']("to_dir"))) {
7628
+
7629
+ $writer = ["to_dir", parent_doc.$options()['$[]']("to_dir")];
7630
+ $send(options, '[]=', Opal.to_a($writer));
7631
+ $writer[$rb_minus($writer["length"], 1)];};
7571
7632
  self.catalog = parent_doc.$catalog().$merge($hash2(["footnotes"], {"footnotes": []}));
7572
7633
  self.attribute_overrides = (attr_overrides = parent_doc.$instance_variable_get("@attribute_overrides").$merge(parent_doc.$attributes()));
7573
7634
  attr_overrides.$delete("compat-mode");
@@ -9387,7 +9448,7 @@ Opal.modules["asciidoctor/parser"] = function(Opal) {
9387
9448
  }
9388
9449
  var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $send = Opal.send, $truthy = Opal.truthy, $hash2 = Opal.hash2, $gvars = Opal.gvars;
9389
9450
 
9390
- Opal.add_stubs(['$include', '$new', '$proc', '$start_with?', '$match?', '$is_delimited_block?', '$private_class_method', '$parse_document_header', '$[]', '$has_more_lines?', '$next_section', '$assign_numeral', '$<<', '$blocks', '$skip_blank_lines', '$parse_block_metadata_lines', '$attributes', '$is_next_line_doctitle?', '$[]=', '$-', '$finalize_header', '$nil_or_empty?', '$title=', '$sourcemap', '$cursor', '$parse_section_title', '$id=', '$include?', '$sub_specialchars', '$sub_attributes', '$source_location=', '$header', '$attribute_locked?', '$id', '$clear', '$delete', '$instance_variable_get', '$parse_header_metadata', '$==', '$!', '$register', '$process_authors', '$update', '$doctype', '$parse_manpage_header', '$=~', '$downcase', '$error', '$logger', '$message_with_context', '$cursor_at_line', '$backend', '$save', '$is_next_line_section?', '$initialize_section', '$join', '$map', '$read_lines_until', '$lstrip', '$split', '$title', '$restore_save', '$discard_save', '$context', '$empty?', '$header?', '$!=', '$attr?', '$attr', '$key?', '$document', '$+', '$level', '$special', '$sectname', '$to_i', '$<', '$>', '$warn', '$next_block', '$blocks?', '$style', '$context=', '$style=', '$parent=', '$size', '$content_model', '$shift', '$unwrap_standalone_preamble', '$source_location', '$merge', '$fetch', '$parse_block_metadata_line', '$extensions', '$block_macros?', '$mark', '$read_line', '$terminator', '$to_s', '$masq', '$to_sym', '$registered_for_block?', '$debug?', '$debug', '$cursor_at_mark', '$strict_verbatim_paragraphs', '$unshift_line', '$markdown_syntax', '$keys', '$chr', '$uniform?', '$length', '$end_with?', '$===', '$parse_attributes', '$attribute_missing', '$tr', '$basename', '$assign_caption', '$registered_for_block_macro?', '$config', '$process_method', '$replace', '$parse_callout_list', '$callouts', '$parse_list', '$parse_description_list', '$underline_style_section_titles', '$is_section_title?', '$peek_line', '$atx_section_title?', '$generate_id', '$level=', '$read_paragraph_lines', '$adjust_indentation!', '$map!', '$slice', '$pop', '$build_block', '$apply_subs', '$chop', '$catalog_inline_anchors', '$rekey', '$index', '$strip', '$parse_table', '$each', '$raise', '$title?', '$update_attributes', '$commit_subs', '$sub?', '$catalog_callouts', '$source', '$remove_sub', '$block_terminates_paragraph', '$to_proc', '$nil?', '$lines', '$parse_blocks', '$parse_list_item', '$items', '$scan', '$gsub', '$count', '$advance', '$dup', '$match', '$callout_ids', '$next_list', '$catalog_inline_anchor', '$marker=', '$catalog_inline_biblio_anchor', '$set_option', '$text=', '$resolve_ordered_list_marker', '$read_lines_for_list_item', '$skip_line_comments', '$unshift_lines', '$fold_first', '$text?', '$is_sibling_list_item?', '$concat', '$find', '$casecmp', '$sectname=', '$special=', '$numbered=', '$numbered', '$lineno', '$peek_lines', '$setext_section_title?', '$abs', '$cursor_at_prev_line', '$process_attribute_entries', '$next_line_empty?', '$apply_header_subs', '$rstrip', '$each_with_index', '$compact', '$to_h', '$squeeze', '$to_a', '$parse_style_attribute', '$process_attribute_entry', '$skip_comment_lines', '$store_attribute', '$sanitize_attribute_name', '$set_attribute', '$save_to', '$delete_attribute', '$ord', '$int_to_roman', '$resolve_list_marker', '$parse_colspecs', '$create_columns', '$has_header_option=', '$format', '$starts_with_delimiter?', '$close_open_cell', '$parse_cellspec', '$delimiter', '$match_delimiter', '$pre_match', '$post_match', '$buffer_has_unclosed_quotes?', '$skip_past_delimiter', '$buffer', '$buffer=', '$skip_past_escaped_delimiter', '$keep_cell_open', '$push_cellspec', '$close_cell', '$cell_open?', '$columns', '$assign_column_widths', '$partition_header_footer', '$upto', '$partition', '$shorthand_property_syntax', '$each_char', '$yield_buffered_attribute', '$any?', '$*', '$each_byte', '$%']);
9451
+ Opal.add_stubs(['$include', '$new', '$proc', '$start_with?', '$match?', '$is_delimited_block?', '$extend', '$private_class_method', '$parse_document_header', '$[]', '$has_more_lines?', '$next_section', '$assign_numeral', '$<<', '$blocks', '$skip_blank_lines', '$parse_block_metadata_lines', '$attributes', '$is_next_line_doctitle?', '$[]=', '$-', '$finalize_header', '$nil_or_empty?', '$title=', '$sourcemap', '$cursor', '$parse_section_title', '$id=', '$include?', '$sub_specialchars', '$sub_attributes', '$source_location=', '$header', '$attribute_locked?', '$id', '$clear', '$delete', '$instance_variable_get', '$parse_header_metadata', '$==', '$!', '$register', '$process_authors', '$update', '$doctype', '$parse_manpage_header', '$=~', '$downcase', '$error', '$logger', '$message_with_context', '$cursor_at_line', '$backend', '$save', '$is_next_line_section?', '$initialize_section', '$join', '$map', '$read_lines_until', '$lstrip', '$split', '$title', '$restore_save', '$discard_save', '$context', '$empty?', '$header?', '$!=', '$attr?', '$attr', '$key?', '$document', '$+', '$level', '$special', '$sectname', '$to_i', '$<', '$>', '$warn', '$next_block', '$blocks?', '$style', '$style=', '$parent=', '$content_model', '$content_model=', '$lines', '$subs', '$size', '$context=', '$shift', '$unwrap_standalone_preamble', '$source_location', '$merge', '$fetch', '$parse_block_metadata_line', '$extensions', '$block_macros?', '$mark', '$read_line', '$terminator', '$to_s', '$masq', '$to_sym', '$registered_for_block?', '$debug?', '$debug', '$cursor_at_mark', '$strict_verbatim_paragraphs', '$unshift_line', '$markdown_syntax', '$keys', '$chr', '$uniform?', '$length', '$end_with?', '$===', '$parse_attributes', '$attribute_missing', '$tr', '$basename', '$assign_caption', '$registered_for_block_macro?', '$config', '$process_method', '$replace', '$parse_callout_list', '$callouts', '$parse_list', '$parse_description_list', '$underline_style_section_titles', '$is_section_title?', '$peek_line', '$atx_section_title?', '$generate_id', '$level=', '$read_paragraph_lines', '$adjust_indentation!', '$map!', '$slice', '$pop', '$build_block', '$apply_subs', '$chop', '$catalog_inline_anchors', '$rekey', '$index', '$strip', '$parse_table', '$each', '$raise', '$title?', '$update_attributes', '$commit_subs', '$sub?', '$catalog_callouts', '$source', '$remove_sub', '$block_terminates_paragraph', '$to_proc', '$nil?', '$parse_blocks', '$parse_list_item', '$items', '$scan', '$gsub', '$count', '$advance', '$dup', '$match', '$callout_ids', '$next_list', '$catalog_inline_anchor', '$marker=', '$catalog_inline_biblio_anchor', '$set_option', '$text=', '$resolve_ordered_list_marker', '$read_lines_for_list_item', '$skip_line_comments', '$unshift_lines', '$fold_first', '$text?', '$is_sibling_list_item?', '$concat', '$find', '$casecmp', '$sectname=', '$special=', '$numbered=', '$numbered', '$lineno', '$peek_lines', '$setext_section_title?', '$abs', '$cursor_at_prev_line', '$process_attribute_entries', '$next_line_empty?', '$apply_header_subs', '$rstrip', '$each_with_index', '$compact', '$to_h', '$squeeze', '$to_a', '$parse_style_attribute', '$process_attribute_entry', '$skip_comment_lines', '$store_attribute', '$sanitize_attribute_name', '$set_attribute', '$save_to', '$delete_attribute', '$ord', '$int_to_roman', '$resolve_list_marker', '$parse_colspecs', '$create_columns', '$has_header_option=', '$format', '$starts_with_delimiter?', '$close_open_cell', '$parse_cellspec', '$delimiter', '$match_delimiter', '$pre_match', '$post_match', '$buffer_has_unclosed_quotes?', '$skip_past_delimiter', '$buffer', '$buffer=', '$skip_past_escaped_delimiter', '$keep_cell_open', '$push_cellspec', '$close_cell', '$cell_open?', '$close_table', '$columns', '$assign_column_widths', '$partition_header_footer', '$upto', '$partition', '$shorthand_property_syntax', '$each_char', '$yield_buffered_attribute', '$any?', '$*', '$each_byte', '$%']);
9391
9452
  return (function($base, $parent_nesting) {
9392
9453
  var self = $module($base, 'Asciidoctor');
9393
9454
 
@@ -9429,6 +9490,9 @@ Opal.modules["asciidoctor/parser"] = function(Opal) {
9429
9490
  return ($truthy($a = ($truthy($b = self['$is_delimited_block?'](l)) ? $b : ($truthy($c = l['$start_with?']("[")) ? $$($nesting, 'BlockAttributeLineRx')['$match?'](l) : $c))) ? $a : $$($nesting, 'AnyListRx')['$match?'](l));}, $Parser$3.$$s = self, $Parser$3.$$arity = 1, $Parser$3)));
9430
9491
  Opal.const_set($nesting[0], 'NoOp', nil);
9431
9492
  Opal.const_set($nesting[0], 'AuthorKeys', ["author", "authorinitials", "firstname", "middlename", "lastname", "email"]);
9493
+ Opal.const_set($nesting[0], 'ListContinuationMarker', $$$('::', 'Module').$new());
9494
+ Opal.const_set($nesting[0], 'ListContinuationPlaceholder', $$$('::', 'String').$new().$extend($$($nesting, 'ListContinuationMarker')));
9495
+ Opal.const_set($nesting[0], 'ListContinuationString', $$$('::', 'String').$new($$($nesting, 'LIST_CONTINUATION')).$extend($$($nesting, 'ListContinuationMarker')));
9432
9496
  Opal.const_set($nesting[0], 'TableCellHorzAlignments', $hash2(["<", ">", "^"], {"<": "left", ">": "right", "^": "center"}));
9433
9497
  Opal.const_set($nesting[0], 'TableCellVertAlignments', $hash2(["<", ">", "^"], {"<": "top", ">": "bottom", "^": "middle"}));
9434
9498
  Opal.const_set($nesting[0], 'TableCellStyles', $hash2(["d", "s", "e", "m", "h", "l", "a"], {"d": "none", "s": "strong", "e": "emphasis", "m": "monospaced", "h": "header", "l": "literal", "a": "asciidoc"}));
@@ -9831,16 +9895,11 @@ Opal.modules["asciidoctor/parser"] = function(Opal) {
9831
9895
  if ($truthy(part)) {
9832
9896
  if ($truthy(section['$blocks?']()['$!']())) {
9833
9897
  if ($truthy(new_block.$style()['$!=']("partintro"))) {
9834
- if (new_block.$context()['$==']("paragraph")) {
9835
-
9836
-
9837
- $writer = ["open"];
9838
- $send(new_block, 'context=', Opal.to_a($writer));
9839
- $writer[$rb_minus($writer["length"], 1)];;
9898
+ if ($truthy((($b = new_block.$style()['$==']("open")) ? new_block.$context()['$==']("open") : new_block.$style()['$==']("open")))) {
9840
9899
 
9841
9900
  $writer = ["partintro"];
9842
9901
  $send(new_block, 'style=', Opal.to_a($writer));
9843
- $writer[$rb_minus($writer["length"], 1)];;
9902
+ $writer[$rb_minus($writer["length"], 1)];
9844
9903
  } else {
9845
9904
 
9846
9905
 
@@ -9852,7 +9911,16 @@ Opal.modules["asciidoctor/parser"] = function(Opal) {
9852
9911
  $send(intro, 'style=', Opal.to_a($writer));
9853
9912
  $writer[$rb_minus($writer["length"], 1)];;
9854
9913
  section.$blocks()['$<<'](intro);
9855
- }}
9914
+ }
9915
+ } else if (new_block.$content_model()['$==']("simple")) {
9916
+
9917
+
9918
+ $writer = ["compound"];
9919
+ $send(new_block, 'content_model=', Opal.to_a($writer));
9920
+ $writer[$rb_minus($writer["length"], 1)];;
9921
+ new_block['$<<']($$($nesting, 'Block').$new(new_block, "paragraph", $hash2(["source", "subs"], {"source": new_block.$lines(), "subs": new_block.$subs()})));
9922
+ new_block.$lines().$clear();
9923
+ new_block.$subs().$clear();}
9856
9924
  } else if (section.$blocks().$size()['$=='](1)) {
9857
9925
 
9858
9926
  first_block = section.$blocks()['$[]'](0);
@@ -9864,12 +9932,7 @@ Opal.modules["asciidoctor/parser"] = function(Opal) {
9864
9932
  $writer = [(intro = $$($nesting, 'Block').$new(section, "open", $hash2(["content_model"], {"content_model": "compound"})))];
9865
9933
  $send(new_block, 'parent=', Opal.to_a($writer));
9866
9934
  $writer[$rb_minus($writer["length"], 1)];;
9867
-
9868
- $writer = ["partintro"];
9869
- $send(intro, 'style=', Opal.to_a($writer));
9870
- $writer[$rb_minus($writer["length"], 1)];;
9871
- section.$blocks().$shift();
9872
- if (first_block.$style()['$==']("partintro")) {
9935
+ if (first_block.$style()['$==']((($writer = ["partintro"]), $send(intro, 'style=', Opal.to_a($writer)), $writer[$rb_minus($writer["length"], 1)]))) {
9873
9936
 
9874
9937
 
9875
9938
  $writer = ["paragraph"];
@@ -9879,6 +9942,7 @@ Opal.modules["asciidoctor/parser"] = function(Opal) {
9879
9942
  $writer = [nil];
9880
9943
  $send(first_block, 'style=', Opal.to_a($writer));
9881
9944
  $writer[$rb_minus($writer["length"], 1)];;};
9945
+ section.$blocks().$shift();
9882
9946
  intro['$<<'](first_block);
9883
9947
  section.$blocks()['$<<'](intro);};}};
9884
9948
  ($truthy($b = intro) ? $b : section).$blocks()['$<<'](new_block);
@@ -9981,6 +10045,7 @@ Opal.modules["asciidoctor/parser"] = function(Opal) {
9981
10045
  if ($truthy(($truthy($b = ($truthy($c = style) ? $$($nesting, 'Compliance').$strict_verbatim_paragraphs() : $c)) ? $$($nesting, 'VERBATIM_STYLES')['$include?'](style) : $b))) {
9982
10046
 
9983
10047
  block_context = style.$to_sym();
10048
+ cloaked_context = "paragraph";
9984
10049
  reader.$unshift_line(this_line);
9985
10050
  break;;};
9986
10051
  if ($truthy(text_only)) {
@@ -10347,7 +10412,11 @@ Opal.modules["asciidoctor/parser"] = function(Opal) {
10347
10412
  } else {
10348
10413
  $case = block_context;
10349
10414
  if ("listing"['$===']($case) || "source"['$===']($case)) {
10350
- if ($truthy(($truthy($a = block_context['$==']("source")) ? $a : ($truthy($b = attributes['$[]'](1)['$!']()) ? (language = ($truthy($c = attributes['$[]'](2)) ? $c : doc_attrs['$[]']("source-language"))) : $b)))) {
10415
+ if ($truthy(($truthy($a = block_context['$==']("source")) ? $a : (language = (function() {if ($truthy(attributes['$[]'](1))) {
10416
+ return nil
10417
+ } else {
10418
+ return ($truthy($b = attributes['$[]'](2)) ? $b : doc_attrs['$[]']("source-language"))
10419
+ }; return nil; })())))) {
10351
10420
 
10352
10421
  if ($truthy(language)) {
10353
10422
 
@@ -10369,6 +10438,13 @@ Opal.modules["asciidoctor/parser"] = function(Opal) {
10369
10438
  $writer = ["language", doc_attrs['$[]']("source-language")];
10370
10439
  $send(attributes, '[]=', Opal.to_a($writer));
10371
10440
  $writer[$rb_minus($writer["length"], 1)];};
10441
+ if (cloaked_context['$==']("listing")) {
10442
+ } else {
10443
+
10444
+ $writer = ["cloaked-context", cloaked_context];
10445
+ $send(attributes, '[]=', Opal.to_a($writer));
10446
+ $writer[$rb_minus($writer["length"], 1)];
10447
+ };
10372
10448
  };
10373
10449
  if ($truthy(attributes['$key?']("linenums"))) {
10374
10450
  } else if ($truthy(($truthy($a = attributes['$[]']("linenums-option")) ? $a : doc_attrs['$[]']("source-linenums-option")))) {
@@ -10418,6 +10494,10 @@ Opal.modules["asciidoctor/parser"] = function(Opal) {
10418
10494
  $send(attributes, '[]=', Opal.to_a($writer));
10419
10495
  $writer[$rb_minus($writer["length"], 1)];
10420
10496
  };
10497
+
10498
+ $writer = ["cloaked-context", cloaked_context];
10499
+ $send(attributes, '[]=', Opal.to_a($writer));
10500
+ $writer[$rb_minus($writer["length"], 1)];;
10421
10501
  if ($truthy(attributes['$key?']("linenums"))) {
10422
10502
  } else if ($truthy(($truthy($a = attributes['$[]']("linenums-option")) ? $a : doc_attrs['$[]']("source-linenums-option")))) {
10423
10503
 
@@ -10812,8 +10892,9 @@ Opal.modules["asciidoctor/parser"] = function(Opal) {
10812
10892
  reftext = reftext.$gsub("\\]", "]");
10813
10893
  if ($truthy(reftext['$include?']($$($nesting, 'ATTR_REF_HEAD')))) {
10814
10894
  reftext = document.$sub_attributes(reftext)};
10815
- } else if ($truthy(($truthy($b = reftext['$include?']($$($nesting, 'ATTR_REF_HEAD'))) ? (reftext = document.$sub_attributes(reftext))['$empty?']() : $b))) {
10816
- return nil;}};
10895
+ } else if ($truthy(reftext['$include?']($$($nesting, 'ATTR_REF_HEAD')))) {
10896
+ if ($truthy((reftext = document.$sub_attributes(reftext))['$empty?']())) {
10897
+ reftext = nil}}};
10817
10898
  };
10818
10899
  if ($truthy(document.$register("refs", [id, $$($nesting, 'Inline').$new(block, "anchor", reftext, $hash2(["type", "id"], {"type": "ref", "id": id}))]))) {
10819
10900
  return nil
@@ -11037,7 +11118,7 @@ Opal.modules["asciidoctor/parser"] = function(Opal) {
11037
11118
  };
11038
11119
  }, $Parser_parse_list_item$27.$$arity = -5);
11039
11120
  Opal.defs(self, '$read_lines_for_list_item', $Parser_read_lines_for_list_item$28 = function $$read_lines_for_list_item(reader, list_type, sibling_trait, has_text) {
11040
- var $a, $b, $c, $$29, $$30, $$31, $$32, $$33, self = this, buffer = nil, continuation = nil, within_nested_list = nil, detached_continuation = nil, dlist = nil, this_line = nil, prev_line = nil, $writer = nil, match = nil, nested_list_type = nil, last_line = nil;
11121
+ var $a, $b, $c, $d, $$29, $$30, $$31, $$32, $$33, self = this, buffer = nil, continuation = nil, within_nested_list = nil, detached_continuation = nil, dlist = nil, this_line = nil, prev_line = nil, $writer = nil, match = nil, block_attribute_lines = nil, next_line = nil, interrupt = nil, ch0 = nil, nested_list_type = nil, last_line = nil;
11041
11122
 
11042
11123
 
11043
11124
 
@@ -11058,12 +11139,14 @@ Opal.modules["asciidoctor/parser"] = function(Opal) {
11058
11139
  this_line = reader.$read_line();
11059
11140
  if ($truthy(self['$is_sibling_list_item?'](this_line, list_type, sibling_trait))) {
11060
11141
  break;};
11142
+ if (this_line['$==']($$($nesting, 'LIST_CONTINUATION'))) {
11143
+ this_line = $$($nesting, 'ListContinuationString')};
11061
11144
  prev_line = (function() {if ($truthy(buffer['$empty?']())) {
11062
11145
  return nil
11063
11146
  } else {
11064
11147
  return buffer['$[]'](-1)
11065
11148
  }; return nil; })();
11066
- if (prev_line['$==']($$($nesting, 'LIST_CONTINUATION'))) {
11149
+ if ($truthy($$($nesting, 'ListContinuationMarker')['$==='](prev_line))) {
11067
11150
 
11068
11151
  if (continuation['$==']("inactive")) {
11069
11152
 
@@ -11072,11 +11155,11 @@ Opal.modules["asciidoctor/parser"] = function(Opal) {
11072
11155
  if ($truthy(within_nested_list)) {
11073
11156
  } else {
11074
11157
 
11075
- $writer = [-1, ""];
11158
+ $writer = [-1, $$($nesting, 'ListContinuationPlaceholder')];
11076
11159
  $send(buffer, '[]=', Opal.to_a($writer));
11077
11160
  $writer[$rb_minus($writer["length"], 1)];
11078
11161
  };};
11079
- if (this_line['$==']($$($nesting, 'LIST_CONTINUATION'))) {
11162
+ if ($truthy($$($nesting, 'ListContinuationMarker')['$==='](this_line))) {
11080
11163
 
11081
11164
  if ($truthy(continuation['$!=']("frozen"))) {
11082
11165
 
@@ -11085,16 +11168,37 @@ Opal.modules["asciidoctor/parser"] = function(Opal) {
11085
11168
  this_line = nil;
11086
11169
  continue;;};};
11087
11170
  if ($truthy((match = self['$is_delimited_block?'](this_line, true)))) {
11171
+
11088
11172
  if (continuation['$==']("active")) {
11089
-
11090
- buffer['$<<'](this_line);
11091
- buffer.$concat(reader.$read_lines_until($hash2(["terminator", "read_last_line", "context"], {"terminator": match.$terminator(), "read_last_line": true, "context": nil})));
11092
- continuation = "inactive";
11093
11173
  } else {
11094
11174
  break;
11095
- }
11096
- } else if ($truthy(($truthy($b = ($truthy($c = dlist) ? continuation['$!=']("active") : $c)) ? $$($nesting, 'BlockAttributeLineRx')['$match?'](this_line) : $b))) {
11097
- break;
11175
+ };
11176
+ buffer['$<<'](this_line);
11177
+ buffer.$concat(reader.$read_lines_until($hash2(["terminator", "read_last_line", "context"], {"terminator": match.$terminator(), "read_last_line": true, "context": nil})));
11178
+ continuation = "inactive";
11179
+ } else if ($truthy(($truthy($b = ($truthy($c = ($truthy($d = dlist) ? continuation['$!=']("active") : $d)) ? this_line['$start_with?']("[") : $c)) ? $$($nesting, 'BlockAttributeLineRx')['$match?'](this_line) : $b))) {
11180
+
11181
+ block_attribute_lines = [this_line];
11182
+ while ($truthy((next_line = reader.$peek_line()))) {
11183
+
11184
+ if ($truthy(self['$is_delimited_block?'](next_line))) {
11185
+ interrupt = true
11186
+ } else if ($truthy(($truthy($c = next_line['$empty?']()) ? $c : ($truthy($d = next_line['$start_with?']("[")) ? $$($nesting, 'BlockAttributeLineRx')['$match?'](next_line) : $d)))) {
11187
+
11188
+ block_attribute_lines['$<<'](reader.$read_line());
11189
+ continue;;
11190
+ } else if ($truthy(($truthy($c = $$($nesting, 'AnyListRx')['$match?'](next_line)) ? self['$is_sibling_list_item?'](next_line, list_type, sibling_trait)['$!']() : $c))) {
11191
+ buffer.$concat(block_attribute_lines)
11192
+ } else {
11193
+ interrupt = true
11194
+ };
11195
+ break;;
11196
+ };
11197
+ if ($truthy(interrupt)) {
11198
+
11199
+ this_line = nil;
11200
+ reader.$unshift_lines(block_attribute_lines);
11201
+ break;;};
11098
11202
  } else if ($truthy((($b = continuation['$==']("active")) ? this_line['$empty?']()['$!']() : continuation['$==']("active")))) {
11099
11203
  if ($truthy($$($nesting, 'LiteralParagraphRx')['$match?'](this_line))) {
11100
11204
 
@@ -11112,7 +11216,7 @@ Opal.modules["asciidoctor/parser"] = function(Opal) {
11112
11216
  buffer.$concat(reader.$read_lines_until($hash2(["preserve_last_line", "break_on_blank_lines", "break_on_list_continuation"], {"preserve_last_line": true, "break_on_blank_lines": true, "break_on_list_continuation": true})))
11113
11217
  };
11114
11218
  continuation = "inactive";
11115
- } else if ($truthy(($truthy($b = ($truthy($c = $$($nesting, 'BlockTitleRx')['$match?'](this_line)) ? $c : $$($nesting, 'BlockAttributeLineRx')['$match?'](this_line))) ? $b : $$($nesting, 'AttributeEntryRx')['$match?'](this_line)))) {
11219
+ } else if ($truthy(($truthy($b = ($truthy($c = (($d = (ch0 = this_line.$chr())['$=='](".")) ? $$($nesting, 'BlockTitleRx')['$match?'](this_line) : (ch0 = this_line.$chr())['$==']("."))) ? $c : (($d = ch0['$==']("[")) ? $$($nesting, 'BlockAttributeLineRx')['$match?'](this_line) : ch0['$==']("[")))) ? $b : (($c = ch0['$=='](":")) ? $$($nesting, 'AttributeEntryRx')['$match?'](this_line) : ch0['$=='](":"))))) {
11116
11220
  buffer['$<<'](this_line)
11117
11221
  } else {
11118
11222
 
@@ -11127,7 +11231,7 @@ Opal.modules["asciidoctor/parser"] = function(Opal) {
11127
11231
  if (ctx == null) {
11128
11232
  ctx = nil;
11129
11233
  };
11130
- return $$($nesting, 'ListRxMap')['$[]'](ctx)['$match?'](this_line);}, $$30.$$s = self, $$30.$$arity = 1, $$30))))) {
11234
+ return $$($nesting, 'ListRxMap')['$[]'](ctx)['$=~'](this_line);}, $$30.$$s = self, $$30.$$arity = 1, $$30))))) {
11131
11235
 
11132
11236
  within_nested_list = true;
11133
11237
  if ($truthy((($b = nested_list_type['$==']("dlist")) ? (($c = $gvars['~']) === nil ? nil : $c['$[]'](3))['$nil_or_empty?']() : nested_list_type['$==']("dlist")))) {
@@ -11148,7 +11252,7 @@ Opal.modules["asciidoctor/parser"] = function(Opal) {
11148
11252
  if (this_line['$==']($$($nesting, 'LIST_CONTINUATION'))) {
11149
11253
 
11150
11254
  detached_continuation = buffer.$size();
11151
- buffer['$<<'](this_line);
11255
+ buffer['$<<']($$($nesting, 'ListContinuationString'));
11152
11256
  } else if ($truthy(has_text)) {
11153
11257
  if ($truthy(self['$is_sibling_list_item?'](this_line, list_type, sibling_trait))) {
11154
11258
  break;
@@ -11192,6 +11296,10 @@ Opal.modules["asciidoctor/parser"] = function(Opal) {
11192
11296
  buffer['$<<'](this_line);
11193
11297
  has_text = true;
11194
11298
  };
11299
+ } else if ($truthy($$($nesting, 'ListContinuationMarker')['$==='](this_line))) {
11300
+
11301
+ has_text = true;
11302
+ buffer['$<<'](this_line);
11195
11303
  } else {
11196
11304
 
11197
11305
  if ($truthy(this_line['$empty?']())) {
@@ -11222,17 +11330,18 @@ Opal.modules["asciidoctor/parser"] = function(Opal) {
11222
11330
  reader.$unshift_line(this_line)};
11223
11331
  if ($truthy(detached_continuation)) {
11224
11332
 
11225
- $writer = [detached_continuation, ""];
11333
+ $writer = [detached_continuation, $$($nesting, 'ListContinuationPlaceholder')];
11226
11334
  $send(buffer, '[]=', Opal.to_a($writer));
11227
11335
  $writer[$rb_minus($writer["length"], 1)];};
11228
11336
  while (!($truthy(buffer['$empty?']()))) {
11229
- if ($truthy((last_line = buffer['$[]'](-1))['$empty?']())) {
11230
- buffer.$pop()
11231
- } else {
11337
+ if ($truthy($$($nesting, 'ListContinuationMarker')['$===']((last_line = buffer['$[]'](-1))))) {
11232
11338
 
11233
- if (last_line['$==']($$($nesting, 'LIST_CONTINUATION'))) {
11234
- buffer.$pop()};
11339
+ buffer.$pop();
11235
11340
  break;;
11341
+ } else if ($truthy(last_line['$empty?']())) {
11342
+ buffer.$pop()
11343
+ } else {
11344
+ break;
11236
11345
  }
11237
11346
  };
11238
11347
  return buffer;
@@ -12231,6 +12340,7 @@ Opal.modules["asciidoctor/parser"] = function(Opal) {
12231
12340
  }
12232
12341
  };
12233
12342
  };
12343
+ parser_ctx.$close_table();
12234
12344
  if ($truthy(($truthy($a = (($logical_op_recvr_tmp_2 = table.$attributes()), ($truthy($b = $logical_op_recvr_tmp_2['$[]']("colcount")) ? $b : (($writer = ["colcount", table.$columns().$size()]), $send($logical_op_recvr_tmp_2, '[]=', Opal.to_a($writer)), $writer[$rb_minus($writer["length"], 1)])))['$=='](0)) ? $a : explicit_colspecs))) {
12235
12345
  } else {
12236
12346
  table.$assign_column_widths()
@@ -12719,7 +12829,7 @@ Opal.modules["asciidoctor/path_resolver"] = function(Opal) {
12719
12829
  (function($base, $super, $parent_nesting) {
12720
12830
  var self = $klass($base, $super, 'PathResolver');
12721
12831
 
12722
- var $nesting = [self].concat($parent_nesting), $PathResolver_initialize$1, $PathResolver_absolute_path$ques$2, $a, $PathResolver_root$ques$3, $PathResolver_unc$ques$4, $PathResolver_web_root$ques$5, $PathResolver_descends_from$ques$6, $PathResolver_relative_path$7, $PathResolver_posixify$8, $PathResolver_expand_path$9, $PathResolver_partition_path$11, $PathResolver_join_path$12, $PathResolver_system_path$13, $PathResolver_web_path$16, $PathResolver_extract_uri_prefix$18;
12832
+ var $nesting = [self].concat($parent_nesting), $PathResolver_initialize$1, $PathResolver_absolute_path$ques$2, $a, $PathResolver_root$ques$3, $PathResolver_root$ques$4, $PathResolver_unc$ques$5, $PathResolver_web_root$ques$6, $PathResolver_descends_from$ques$7, $PathResolver_relative_path$8, $PathResolver_posixify$9, $PathResolver_expand_path$10, $PathResolver_partition_path$12, $PathResolver_join_path$13, $PathResolver_system_path$14, $PathResolver_web_path$17, $PathResolver_extract_uri_prefix$19;
12723
12833
 
12724
12834
  self.$$prototype.file_separator = self.$$prototype._partition_path_web = self.$$prototype._partition_path_sys = self.$$prototype.working_dir = nil;
12725
12835
 
@@ -12730,6 +12840,7 @@ Opal.modules["asciidoctor/path_resolver"] = function(Opal) {
12730
12840
  Opal.const_set($nesting[0], 'SLASH', "/");
12731
12841
  Opal.const_set($nesting[0], 'BACKSLASH', "\\");
12732
12842
  Opal.const_set($nesting[0], 'DOUBLE_SLASH', "//");
12843
+ Opal.const_set($nesting[0], 'URI_CLASSLOADER', "uri:classloader:");
12733
12844
  Opal.const_set($nesting[0], 'WindowsRootRx', /^(?:[a-zA-Z]:)?[\\\/]/);
12734
12845
  self.$attr_accessor("file_separator");
12735
12846
  self.$attr_accessor("working_dir");
@@ -12775,23 +12886,30 @@ Opal.modules["asciidoctor/path_resolver"] = function(Opal) {
12775
12886
 
12776
12887
  return ($truthy($a = self['$absolute_path?'](path)) ? $a : path['$start_with?']("file://", "http://", "https://"))
12777
12888
  }, $PathResolver_root$ques$3.$$arity = 1)
12889
+ } else if ($$$('::', 'RUBY_ENGINE')['$==']("jruby")) {
12890
+
12891
+ Opal.def(self, '$root?', $PathResolver_root$ques$4 = function(path) {
12892
+ var $a, self = this;
12893
+
12894
+ return ($truthy($a = self['$absolute_path?'](path)) ? $a : path['$start_with?']($$($nesting, 'URI_CLASSLOADER')))
12895
+ }, $PathResolver_root$ques$4.$$arity = 1)
12778
12896
  } else {
12779
12897
  Opal.alias(self, "root?", "absolute_path?")
12780
12898
  };
12781
12899
 
12782
- Opal.def(self, '$unc?', $PathResolver_unc$ques$4 = function(path) {
12900
+ Opal.def(self, '$unc?', $PathResolver_unc$ques$5 = function(path) {
12783
12901
  var self = this;
12784
12902
 
12785
12903
  return path['$start_with?']($$($nesting, 'DOUBLE_SLASH'))
12786
- }, $PathResolver_unc$ques$4.$$arity = 1);
12904
+ }, $PathResolver_unc$ques$5.$$arity = 1);
12787
12905
 
12788
- Opal.def(self, '$web_root?', $PathResolver_web_root$ques$5 = function(path) {
12906
+ Opal.def(self, '$web_root?', $PathResolver_web_root$ques$6 = function(path) {
12789
12907
  var self = this;
12790
12908
 
12791
12909
  return path['$start_with?']($$($nesting, 'SLASH'))
12792
- }, $PathResolver_web_root$ques$5.$$arity = 1);
12910
+ }, $PathResolver_web_root$ques$6.$$arity = 1);
12793
12911
 
12794
- Opal.def(self, '$descends_from?', $PathResolver_descends_from$ques$6 = function(path, base) {
12912
+ Opal.def(self, '$descends_from?', $PathResolver_descends_from$ques$7 = function(path, base) {
12795
12913
  var $a, self = this;
12796
12914
 
12797
12915
  if (base['$=='](path)) {
@@ -12801,9 +12919,9 @@ Opal.modules["asciidoctor/path_resolver"] = function(Opal) {
12801
12919
  } else {
12802
12920
  return ($truthy($a = path['$start_with?']($rb_plus(base, $$($nesting, 'SLASH')))) ? $rb_plus(base.$length(), 1) : $a)
12803
12921
  }
12804
- }, $PathResolver_descends_from$ques$6.$$arity = 2);
12922
+ }, $PathResolver_descends_from$ques$7.$$arity = 2);
12805
12923
 
12806
- Opal.def(self, '$relative_path', $PathResolver_relative_path$7 = function $$relative_path(path, base) {
12924
+ Opal.def(self, '$relative_path', $PathResolver_relative_path$8 = function $$relative_path(path, base) {
12807
12925
  var self = this, offset = nil;
12808
12926
 
12809
12927
  if ($truthy(self['$root?'](path))) {
@@ -12824,9 +12942,9 @@ Opal.modules["asciidoctor/path_resolver"] = function(Opal) {
12824
12942
  } else {
12825
12943
  return path
12826
12944
  }
12827
- }, $PathResolver_relative_path$7.$$arity = 2);
12945
+ }, $PathResolver_relative_path$8.$$arity = 2);
12828
12946
 
12829
- Opal.def(self, '$posixify', $PathResolver_posixify$8 = function $$posixify(path) {
12947
+ Opal.def(self, '$posixify', $PathResolver_posixify$9 = function $$posixify(path) {
12830
12948
  var $a, self = this;
12831
12949
 
12832
12950
  if ($truthy(path)) {
@@ -12839,18 +12957,18 @@ Opal.modules["asciidoctor/path_resolver"] = function(Opal) {
12839
12957
  } else {
12840
12958
  return ""
12841
12959
  }
12842
- }, $PathResolver_posixify$8.$$arity = 1);
12960
+ }, $PathResolver_posixify$9.$$arity = 1);
12843
12961
  Opal.alias(self, "posixfy", "posixify");
12844
12962
 
12845
- Opal.def(self, '$expand_path', $PathResolver_expand_path$9 = function $$expand_path(path) {
12846
- var $a, $b, $$10, self = this, path_segments = nil, path_root = nil, resolved_segments = nil;
12963
+ Opal.def(self, '$expand_path', $PathResolver_expand_path$10 = function $$expand_path(path) {
12964
+ var $a, $b, $$11, self = this, path_segments = nil, path_root = nil, resolved_segments = nil;
12847
12965
 
12848
12966
 
12849
12967
  $b = self.$partition_path(path), $a = Opal.to_ary($b), (path_segments = ($a[0] == null ? nil : $a[0])), (path_root = ($a[1] == null ? nil : $a[1])), $b;
12850
12968
  if ($truthy(path['$include?']($$($nesting, 'DOT_DOT')))) {
12851
12969
 
12852
12970
  resolved_segments = [];
12853
- $send(path_segments, 'each', [], ($$10 = function(segment){var self = $$10.$$s || this;
12971
+ $send(path_segments, 'each', [], ($$11 = function(segment){var self = $$11.$$s || this;
12854
12972
 
12855
12973
 
12856
12974
 
@@ -12861,14 +12979,14 @@ Opal.modules["asciidoctor/path_resolver"] = function(Opal) {
12861
12979
  return resolved_segments.$pop()
12862
12980
  } else {
12863
12981
  return resolved_segments['$<<'](segment)
12864
- };}, $$10.$$s = self, $$10.$$arity = 1, $$10));
12982
+ };}, $$11.$$s = self, $$11.$$arity = 1, $$11));
12865
12983
  return self.$join_path(resolved_segments, path_root);
12866
12984
  } else {
12867
12985
  return self.$join_path(path_segments, path_root)
12868
12986
  };
12869
- }, $PathResolver_expand_path$9.$$arity = 1);
12987
+ }, $PathResolver_expand_path$10.$$arity = 1);
12870
12988
 
12871
- Opal.def(self, '$partition_path', $PathResolver_partition_path$11 = function $$partition_path(path, web) {
12989
+ Opal.def(self, '$partition_path', $PathResolver_partition_path$12 = function $$partition_path(path, web) {
12872
12990
  var self = this, result = nil, cache = nil, posix_path = nil, root = nil, path_segments = nil, $writer = nil;
12873
12991
 
12874
12992
 
@@ -12893,6 +13011,8 @@ Opal.modules["asciidoctor/path_resolver"] = function(Opal) {
12893
13011
  root = $$($nesting, 'DOUBLE_SLASH')
12894
13012
  } else if ($truthy(posix_path['$start_with?']($$($nesting, 'SLASH')))) {
12895
13013
  root = $$($nesting, 'SLASH')
13014
+ } else if ($truthy(posix_path['$start_with?']($$($nesting, 'URI_CLASSLOADER')))) {
13015
+ root = posix_path.$slice(0, $$($nesting, 'URI_CLASSLOADER').$length())
12896
13016
  } else {
12897
13017
  root = posix_path.$slice(0, $rb_plus(posix_path.$index($$($nesting, 'SLASH')), 1))
12898
13018
  }
@@ -12909,9 +13029,9 @@ Opal.modules["asciidoctor/path_resolver"] = function(Opal) {
12909
13029
  $writer = [path, [path_segments, root]];
12910
13030
  $send(cache, '[]=', Opal.to_a($writer));
12911
13031
  return $writer[$rb_minus($writer["length"], 1)];;
12912
- }, $PathResolver_partition_path$11.$$arity = -2);
13032
+ }, $PathResolver_partition_path$12.$$arity = -2);
12913
13033
 
12914
- Opal.def(self, '$join_path', $PathResolver_join_path$12 = function $$join_path(segments, root) {
13034
+ Opal.def(self, '$join_path', $PathResolver_join_path$13 = function $$join_path(segments, root) {
12915
13035
  var self = this;
12916
13036
 
12917
13037
 
@@ -12925,10 +13045,10 @@ Opal.modules["asciidoctor/path_resolver"] = function(Opal) {
12925
13045
 
12926
13046
  return segments.$join($$($nesting, 'SLASH'));
12927
13047
  };
12928
- }, $PathResolver_join_path$12.$$arity = -2);
13048
+ }, $PathResolver_join_path$13.$$arity = -2);
12929
13049
 
12930
- Opal.def(self, '$system_path', $PathResolver_system_path$13 = function $$system_path(target, start, jail, opts) {
12931
- var $a, $b, $$14, $$15, self = this, target_path = nil, target_segments = nil, jail_segments = nil, jail_root = nil, recheck = nil, start_segments = nil, start_root = nil, resolved_segments = nil, unresolved_segments = nil, warned = nil;
13050
+ Opal.def(self, '$system_path', $PathResolver_system_path$14 = function $$system_path(target, start, jail, opts) {
13051
+ var $a, $b, $$15, $$16, self = this, target_path = nil, target_segments = nil, jail_segments = nil, jail_root = nil, recheck = nil, start_segments = nil, start_root = nil, resolved_segments = nil, unresolved_segments = nil, warned = nil;
12932
13052
 
12933
13053
 
12934
13054
 
@@ -13019,7 +13139,7 @@ Opal.modules["asciidoctor/path_resolver"] = function(Opal) {
13019
13139
  $b = self.$partition_path(jail), $a = Opal.to_ary($b), (jail_segments = ($a[0] == null ? nil : $a[0])), $b
13020
13140
  };
13021
13141
  warned = false;
13022
- $send(unresolved_segments, 'each', [], ($$14 = function(segment){var self = $$14.$$s || this, $c;
13142
+ $send(unresolved_segments, 'each', [], ($$15 = function(segment){var self = $$15.$$s || this, $c;
13023
13143
 
13024
13144
 
13025
13145
 
@@ -13042,9 +13162,9 @@ Opal.modules["asciidoctor/path_resolver"] = function(Opal) {
13042
13162
  }
13043
13163
  } else {
13044
13164
  return resolved_segments['$<<'](segment)
13045
- };}, $$14.$$s = self, $$14.$$arity = 1, $$14));
13165
+ };}, $$15.$$s = self, $$15.$$arity = 1, $$15));
13046
13166
  } else {
13047
- $send(unresolved_segments, 'each', [], ($$15 = function(segment){var self = $$15.$$s || this;
13167
+ $send(unresolved_segments, 'each', [], ($$16 = function(segment){var self = $$16.$$s || this;
13048
13168
 
13049
13169
 
13050
13170
 
@@ -13055,7 +13175,7 @@ Opal.modules["asciidoctor/path_resolver"] = function(Opal) {
13055
13175
  return resolved_segments.$pop()
13056
13176
  } else {
13057
13177
  return resolved_segments['$<<'](segment)
13058
- };}, $$15.$$s = self, $$15.$$arity = 1, $$15))
13178
+ };}, $$16.$$s = self, $$16.$$arity = 1, $$16))
13059
13179
  };};
13060
13180
  if ($truthy(recheck)) {
13061
13181
 
@@ -13076,10 +13196,10 @@ Opal.modules["asciidoctor/path_resolver"] = function(Opal) {
13076
13196
  } else {
13077
13197
  return self.$join_path(resolved_segments, jail_root)
13078
13198
  };
13079
- }, $PathResolver_system_path$13.$$arity = -2);
13199
+ }, $PathResolver_system_path$14.$$arity = -2);
13080
13200
 
13081
- Opal.def(self, '$web_path', $PathResolver_web_path$16 = function $$web_path(target, start) {
13082
- var $a, $b, $$17, self = this, uri_prefix = nil, target_segments = nil, target_root = nil, resolved_segments = nil, resolved_path = nil;
13201
+ Opal.def(self, '$web_path', $PathResolver_web_path$17 = function $$web_path(target, start) {
13202
+ var $a, $b, $$18, self = this, uri_prefix = nil, target_segments = nil, target_root = nil, resolved_segments = nil, resolved_path = nil;
13083
13203
 
13084
13204
 
13085
13205
 
@@ -13098,7 +13218,7 @@ Opal.modules["asciidoctor/path_resolver"] = function(Opal) {
13098
13218
  };
13099
13219
  $b = self.$partition_path(target, true), $a = Opal.to_ary($b), (target_segments = ($a[0] == null ? nil : $a[0])), (target_root = ($a[1] == null ? nil : $a[1])), $b;
13100
13220
  resolved_segments = [];
13101
- $send(target_segments, 'each', [], ($$17 = function(segment){var self = $$17.$$s || this, $c;
13221
+ $send(target_segments, 'each', [], ($$18 = function(segment){var self = $$18.$$s || this, $c;
13102
13222
 
13103
13223
 
13104
13224
 
@@ -13119,7 +13239,7 @@ Opal.modules["asciidoctor/path_resolver"] = function(Opal) {
13119
13239
  }
13120
13240
  } else {
13121
13241
  return resolved_segments['$<<'](segment)
13122
- };}, $$17.$$s = self, $$17.$$arity = 1, $$17));
13242
+ };}, $$18.$$s = self, $$18.$$arity = 1, $$18));
13123
13243
  if ($truthy((resolved_path = self.$join_path(resolved_segments, target_root))['$include?'](" "))) {
13124
13244
  resolved_path = resolved_path.$gsub(" ", "%20")};
13125
13245
  if ($truthy(uri_prefix)) {
@@ -13127,9 +13247,9 @@ Opal.modules["asciidoctor/path_resolver"] = function(Opal) {
13127
13247
  } else {
13128
13248
  return resolved_path
13129
13249
  };
13130
- }, $PathResolver_web_path$16.$$arity = -2);
13250
+ }, $PathResolver_web_path$17.$$arity = -2);
13131
13251
  self.$private();
13132
- return (Opal.def(self, '$extract_uri_prefix', $PathResolver_extract_uri_prefix$18 = function $$extract_uri_prefix(str) {
13252
+ return (Opal.def(self, '$extract_uri_prefix', $PathResolver_extract_uri_prefix$19 = function $$extract_uri_prefix(str) {
13133
13253
  var $a, self = this;
13134
13254
 
13135
13255
  if ($truthy(($truthy($a = str['$include?'](":")) ? $$($nesting, 'UriSniffRx')['$=~'](str) : $a))) {
@@ -13137,7 +13257,7 @@ Opal.modules["asciidoctor/path_resolver"] = function(Opal) {
13137
13257
  } else {
13138
13258
  return str
13139
13259
  }
13140
- }, $PathResolver_extract_uri_prefix$18.$$arity = 1), nil) && 'extract_uri_prefix';
13260
+ }, $PathResolver_extract_uri_prefix$19.$$arity = 1), nil) && 'extract_uri_prefix';
13141
13261
  })($nesting[0], null, $nesting)
13142
13262
  })($nesting[0], $nesting)
13143
13263
  };
@@ -13164,7 +13284,7 @@ Opal.modules["asciidoctor/reader"] = function(Opal) {
13164
13284
  }
13165
13285
  var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2, $truthy = Opal.truthy, $send = Opal.send, $gvars = Opal.gvars, $hash = Opal.hash;
13166
13286
 
13167
- Opal.add_stubs(['$include', '$attr_reader', '$+', '$attr_accessor', '$!', '$===', '$split', '$file', '$dir', '$dirname', '$path', '$basename', '$lineno', '$reverse', '$prepare_lines', '$empty?', '$nil_or_empty?', '$peek_line', '$>', '$slice', '$[]', '$length', '$process_line', '$times', '$shift', '$read_line', '$<<', '$-', '$unshift_all', '$has_more_lines?', '$join', '$read_lines', '$unshift', '$start_with?', '$==', '$*', '$read_lines_until', '$size', '$clear', '$cursor', '$[]=', '$!=', '$fetch', '$cursor_at_mark', '$warn', '$logger', '$message_with_context', '$pop', '$push', '$respond_to?', '$reverse_each', '$new', '$tap', '$each', '$instance_variables', '$instance_variable_get', '$drop', '$instance_variable_set', '$class', '$object_id', '$inspect', '$private', '$prepare_source_array', '$prepare_source_string', '$chomp', '$valid_encoding?', '$to_s', '$raise', '$to_i', '$attributes', '$catalog', '$pop_include', '$parse', '$path=', '$dup', '$end_with?', '$keys', '$rindex', '$rootname', '$key?', '$attr', '$reverse!', '$>=', '$nil?', '$extensions?', '$include_processors?', '$extensions', '$include_processors', '$map', '$skip_front_matter!', '$adjust_indentation!', '$include?', '$=~', '$preprocess_conditional_directive', '$preprocess_include_directive', '$downcase', '$error', '$none?', '$any?', '$all?', '$strip', '$send', '$resolve_expr_val', '$replace_next_line', '$rstrip', '$sub_attributes', '$attribute_missing', '$info', '$parse_attributes', '$find', '$handles?', '$instance', '$process_method', '$safe', '$resolve_include_path', '$method', '$split_delimited_value', '$partition', '$<', '$to_a', '$uniq', '$sort', '$call', '$each_line', '$infinite?', '$push_include', '$delete', '$first', '$values', '$value?', '$create_include_cursor', '$delete_at', '$keep_if', '$read', '$uriish?', '$attr?', '$require_library', '$normalize_system_path', '$file?', '$relative_path', '$path_resolver', '$base_dir', '$to_f']);
13287
+ Opal.add_stubs(['$include', '$attr_reader', '$+', '$attr_accessor', '$!', '$===', '$split', '$file', '$dir', '$dirname', '$path', '$basename', '$lineno', '$reverse', '$prepare_lines', '$empty?', '$nil_or_empty?', '$peek_line', '$[]', '$>', '$slice', '$length', '$process_line', '$times', '$shift', '$read_line', '$<<', '$-', '$unshift_all', '$has_more_lines?', '$join', '$read_lines', '$unshift', '$start_with?', '$==', '$*', '$read_lines_until', '$size', '$clear', '$cursor', '$[]=', '$!=', '$fetch', '$cursor_at_mark', '$warn', '$logger', '$message_with_context', '$pop', '$push', '$respond_to?', '$reverse_each', '$new', '$tap', '$each', '$instance_variables', '$instance_variable_get', '$drop', '$instance_variable_set', '$class', '$object_id', '$inspect', '$private', '$prepare_source_array', '$prepare_source_string', '$chomp', '$valid_encoding?', '$to_s', '$raise', '$to_i', '$attributes', '$catalog', '$pop_include', '$parse', '$path=', '$dup', '$end_with?', '$keys', '$rindex', '$rootname', '$key?', '$attr', '$reverse!', '$>=', '$nil?', '$extensions?', '$include_processors?', '$extensions', '$include_processors', '$map', '$skip_front_matter!', '$adjust_indentation!', '$include?', '$=~', '$preprocess_conditional_directive', '$preprocess_include_directive', '$downcase', '$error', '$none?', '$any?', '$all?', '$strip', '$send', '$resolve_expr_val', '$replace_next_line', '$rstrip', '$sub_attributes', '$attribute_missing', '$info', '$parse_attributes', '$find', '$handles?', '$instance', '$process_method', '$safe', '$resolve_include_path', '$method', '$split_delimited_value', '$partition', '$<', '$to_a', '$uniq', '$sort', '$call', '$each_line', '$infinite?', '$push_include', '$delete', '$first', '$values', '$value?', '$create_include_cursor', '$delete_at', '$keep_if', '$read', '$uriish?', '$attr?', '$require_library', '$normalize_system_path', '$file?', '$relative_path', '$path_resolver', '$base_dir', '$to_f']);
13168
13288
  return (function($base, $parent_nesting) {
13169
13289
  var self = $module($base, 'Asciidoctor');
13170
13290
 
@@ -13309,26 +13429,31 @@ Opal.modules["asciidoctor/reader"] = function(Opal) {
13309
13429
  }, $Reader_next_line_empty$ques$7.$$arity = 0);
13310
13430
 
13311
13431
  Opal.def(self, '$peek_line', $Reader_peek_line$8 = function $$peek_line(direct) {
13312
- var $a, self = this, line = nil;
13432
+ var $a, $b, self = this, next_line = nil, line = nil;
13313
13433
 
13314
13434
 
13315
13435
 
13316
13436
  if (direct == null) {
13317
13437
  direct = false;
13318
13438
  };
13319
- if ($truthy(($truthy($a = direct) ? $a : $rb_gt(self.look_ahead, 0)))) {
13320
- if ($truthy(self.unescape_next_line)) {
13321
-
13322
- return (line = self.lines['$[]'](-1)).$slice(1, line.$length());
13323
- } else {
13324
- return self.lines['$[]'](-1)
13325
- }
13326
- } else if ($truthy(self.lines['$empty?']())) {
13439
+ while ($truthy(true)) {
13327
13440
 
13328
- self.look_ahead = 0;
13329
- return nil;
13330
- } else {
13331
- return ($truthy($a = self.$process_line(self.lines['$[]'](-1))) ? $a : self.$peek_line())
13441
+ next_line = self.lines['$[]'](-1);
13442
+ if ($truthy(($truthy($b = direct) ? $b : $rb_gt(self.look_ahead, 0)))) {
13443
+ return (function() {if ($truthy(self.unescape_next_line)) {
13444
+
13445
+ return next_line.$slice(1, next_line.$length());
13446
+ } else {
13447
+ return next_line
13448
+ }; return nil; })()
13449
+ } else if ($truthy(next_line)) {
13450
+ if ($truthy((line = self.$process_line(next_line)))) {
13451
+ return line}
13452
+ } else {
13453
+
13454
+ self.look_ahead = 0;
13455
+ return nil;
13456
+ };
13332
13457
  };
13333
13458
  }, $Reader_peek_line$8.$$arity = -1);
13334
13459
 
@@ -13822,7 +13947,7 @@ Opal.modules["asciidoctor/reader"] = function(Opal) {
13822
13947
 
13823
13948
  var $nesting = [self].concat($parent_nesting), $PreprocessorReader_initialize$47, $PreprocessorReader_has_more_lines$ques$48, $PreprocessorReader_empty$ques$49, $PreprocessorReader_peek_line$50, $PreprocessorReader_push_include$51, $PreprocessorReader_include_depth$52, $PreprocessorReader_exceeds_max_depth$ques$53, $PreprocessorReader_shift$54, $PreprocessorReader_include_processors$ques$55, $PreprocessorReader_create_include_cursor$56, $PreprocessorReader_to_s$57, $PreprocessorReader_prepare_lines$59, $PreprocessorReader_process_line$60, $PreprocessorReader_preprocess_conditional_directive$61, $PreprocessorReader_preprocess_include_directive$66, $PreprocessorReader_resolve_include_path$80, $PreprocessorReader_pop_include$82, $PreprocessorReader_split_delimited_value$83, $PreprocessorReader_skip_front_matter$excl$84, $PreprocessorReader_resolve_expr_val$85;
13824
13949
 
13825
- self.$$prototype.include_stack = self.$$prototype.lines = self.$$prototype.file = self.$$prototype.dir = self.$$prototype.path = self.$$prototype.lineno = self.$$prototype.maxdepth = self.$$prototype.process_lines = self.$$prototype.includes = self.$$prototype.document = self.$$prototype.unescape_next_line = self.$$prototype.include_processor_extensions = self.$$prototype.look_ahead = self.$$prototype.skipping = self.$$prototype.conditional_stack = nil;
13950
+ self.$$prototype.include_stack = self.$$prototype.lines = self.$$prototype.file = self.$$prototype.dir = self.$$prototype.path = self.$$prototype.lineno = self.$$prototype.maxdepth = self.$$prototype.process_lines = self.$$prototype.includes = self.$$prototype.document = self.$$prototype.unescape_next_line = self.$$prototype.include_processor_extensions = self.$$prototype.skipping = self.$$prototype.look_ahead = self.$$prototype.conditional_stack = nil;
13826
13951
 
13827
13952
  self.$attr_reader("include_stack");
13828
13953
 
@@ -13943,27 +14068,21 @@ Opal.modules["asciidoctor/reader"] = function(Opal) {
13943
14068
  };
13944
14069
  self.path = (path = ($truthy($a = path) ? $a : $$$('::', 'File').$basename(file)));
13945
14070
  if ($truthy((self.process_lines = $send(file, 'end_with?', Opal.to_a($$($nesting, 'ASCIIDOC_EXTENSIONS').$keys()))))) {
13946
-
13947
- $writer = [path.$slice(0, path.$rindex(".")), (function() {if ($truthy(attributes['$[]']("partial-option"))) {
14071
+ ($truthy($a = self.includes['$[]'](path.$slice(0, path.$rindex(".")))) ? $a : (($writer = [path.$slice(0, path.$rindex(".")), (function() {if ($truthy(attributes['$[]']("partial-option"))) {
13948
14072
  return nil
13949
14073
  } else {
13950
14074
  return true
13951
- }; return nil; })()];
13952
- $send(self.includes, '[]=', Opal.to_a($writer));
13953
- $writer[$rb_minus($writer["length"], 1)];};
14075
+ }; return nil; })()]), $send(self.includes, '[]=', Opal.to_a($writer)), $writer[$rb_minus($writer["length"], 1)]))};
13954
14076
  } else {
13955
14077
 
13956
14078
  self.dir = ".";
13957
14079
  self.process_lines = true;
13958
14080
  if ($truthy((self.path = path))) {
13959
-
13960
- $writer = [$$($nesting, 'Helpers').$rootname(path), (function() {if ($truthy(attributes['$[]']("partial-option"))) {
14081
+ ($truthy($a = self.includes['$[]']($$($nesting, 'Helpers').$rootname(path))) ? $a : (($writer = [$$($nesting, 'Helpers').$rootname(path), (function() {if ($truthy(attributes['$[]']("partial-option"))) {
13961
14082
  return nil
13962
14083
  } else {
13963
14084
  return true
13964
- }; return nil; })()];
13965
- $send(self.includes, '[]=', Opal.to_a($writer));
13966
- $writer[$rb_minus($writer["length"], 1)];
14085
+ }; return nil; })()]), $send(self.includes, '[]=', Opal.to_a($writer)), $writer[$rb_minus($writer["length"], 1)]))
13967
14086
  } else {
13968
14087
  self.path = "<stdin>"
13969
14088
  };
@@ -14114,6 +14233,10 @@ Opal.modules["asciidoctor/reader"] = function(Opal) {
14114
14233
  };
14115
14234
  if ($truthy(line['$empty?']())) {
14116
14235
 
14236
+ if ($truthy(self.skipping)) {
14237
+
14238
+ self.$shift();
14239
+ return nil;};
14117
14240
  self.look_ahead = $rb_plus(self.look_ahead, 1);
14118
14241
  return line;};
14119
14242
  if ($truthy(($truthy($a = ($truthy($b = line['$end_with?']("]")) ? line['$start_with?']("[")['$!']() : $b)) ? line['$include?']("::") : $a))) {
@@ -14345,7 +14468,10 @@ Opal.modules["asciidoctor/reader"] = function(Opal) {
14345
14468
  ext.$process_method()['$[]'](doc, self, expanded_target, doc.$parse_attributes(attrlist, [], $hash2(["sub_input"], {"sub_input": true})));
14346
14469
  return true;
14347
14470
  } else if ($truthy($rb_ge(doc.$safe(), $$$($$($nesting, 'SafeMode'), 'SECURE')))) {
14348
- return self.$replace_next_line("" + "link:" + (expanded_target) + "[]")
14471
+
14472
+ if ($truthy(expanded_target['$include?'](" "))) {
14473
+ expanded_target = "" + "pass:c[" + (expanded_target) + "]"};
14474
+ return self.$replace_next_line("" + "link:" + (expanded_target) + "[role=include]");
14349
14475
  } else if ($truthy(self.maxdepth)) {
14350
14476
 
14351
14477
  if ($truthy($rb_ge(self.include_stack.$size(), self.maxdepth['$[]']("curr")))) {
@@ -14657,6 +14783,8 @@ Opal.modules["asciidoctor/reader"] = function(Opal) {
14657
14783
  self.$push_include(inc_lines, inc_path, relpath, inc_offset, parsed_attrs);};
14658
14784
  } else {
14659
14785
 
14786
+ inc_content = nil;
14787
+
14660
14788
  try {
14661
14789
 
14662
14790
  inc_content = $send(reader, 'call', [inc_path, read_mode], ($$79 = function(f){var self = $$79.$$s || this;
@@ -14668,7 +14796,6 @@ Opal.modules["asciidoctor/reader"] = function(Opal) {
14668
14796
  };
14669
14797
  return f.$read();}, $$79.$$s = self, $$79.$$arity = 1, $$79));
14670
14798
  self.$shift();
14671
- self.$push_include(inc_content, inc_path, relpath, 1, parsed_attrs);
14672
14799
  } catch ($err) {
14673
14800
  if (Opal.rescue($err, [$$($nesting, 'StandardError')])) {
14674
14801
  try {
@@ -14677,7 +14804,8 @@ Opal.modules["asciidoctor/reader"] = function(Opal) {
14677
14804
  return self.$replace_next_line("" + "Unresolved directive in " + (self.path) + " - include::" + (expanded_target) + "[" + (attrlist) + "]");
14678
14805
  } finally { Opal.pop_exception() }
14679
14806
  } else { throw $err; }
14680
- };
14807
+ };;
14808
+ self.$push_include(inc_content, inc_path, relpath, 1, parsed_attrs);
14681
14809
  };
14682
14810
  return true;
14683
14811
  } else {
@@ -14699,7 +14827,10 @@ Opal.modules["asciidoctor/reader"] = function(Opal) {
14699
14827
 
14700
14828
  if ($truthy(doc['$attr?']("allow-uri-read"))) {
14701
14829
  } else {
14702
- return self.$replace_next_line("" + "link:" + (target) + "[" + (attrlist) + "]")
14830
+
14831
+ if ($truthy(target['$include?'](" "))) {
14832
+ target = "" + "pass:c[" + (target) + "]"};
14833
+ return self.$replace_next_line("" + "link:" + (target) + "[role=include]");
14703
14834
  };
14704
14835
  if ($truthy(doc['$attr?']("cache-uri"))) {
14705
14836
  if ($truthy((($b = $$$('::', 'OpenURI', 'skip_raise')) && ($a = $$$($b, 'Cache', 'skip_raise')) ? 'constant' : nil))) {
@@ -14756,39 +14887,37 @@ Opal.modules["asciidoctor/reader"] = function(Opal) {
14756
14887
  }, $PreprocessorReader_split_delimited_value$83.$$arity = 1);
14757
14888
 
14758
14889
  Opal.def(self, '$skip_front_matter!', $PreprocessorReader_skip_front_matter$excl$84 = function(data, increment_linenos) {
14759
- var $a, $b, self = this, front_matter = nil, original_data = nil;
14890
+ var $a, $b, self = this, delim = nil, original_data = nil, front_matter = nil, eof = nil;
14760
14891
 
14761
14892
 
14762
14893
 
14763
14894
  if (increment_linenos == null) {
14764
14895
  increment_linenos = true;
14765
14896
  };
14766
- front_matter = nil;
14767
- if (data['$[]'](0)['$==']("---")) {
14897
+ if ((delim = data['$[]'](0))['$==']("---")) {
14898
+ } else {
14899
+ return nil
14900
+ };
14901
+ original_data = data.$drop(0);
14902
+ data.$shift();
14903
+ front_matter = [];
14904
+ if ($truthy(increment_linenos)) {
14905
+ self.lineno = $rb_plus(self.lineno, 1)};
14906
+ while (!($truthy(($truthy($b = (eof = data['$empty?']())) ? $b : data['$[]'](0)['$=='](delim))))) {
14768
14907
 
14769
- original_data = data.$drop(0);
14770
- data.$shift();
14771
- front_matter = [];
14908
+ front_matter['$<<'](data.$shift());
14772
14909
  if ($truthy(increment_linenos)) {
14773
14910
  self.lineno = $rb_plus(self.lineno, 1)};
14774
- while ($truthy(($truthy($b = data['$empty?']()['$!']()) ? data['$[]'](0)['$!=']("---") : $b))) {
14775
-
14776
- front_matter['$<<'](data.$shift());
14777
- if ($truthy(increment_linenos)) {
14778
- self.lineno = $rb_plus(self.lineno, 1)};
14779
- };
14780
- if ($truthy(data['$empty?']())) {
14781
-
14782
- $send(data, 'unshift', Opal.to_a(original_data));
14783
- if ($truthy(increment_linenos)) {
14784
- self.lineno = 0};
14785
- front_matter = nil;
14786
- } else {
14787
-
14788
- data.$shift();
14789
- if ($truthy(increment_linenos)) {
14790
- self.lineno = $rb_plus(self.lineno, 1)};
14791
- };};
14911
+ };
14912
+ if ($truthy(eof)) {
14913
+
14914
+ $send(data, 'unshift', Opal.to_a(original_data));
14915
+ if ($truthy(increment_linenos)) {
14916
+ self.lineno = $rb_minus(self.lineno, original_data.$size())};
14917
+ return nil;};
14918
+ data.$shift();
14919
+ if ($truthy(increment_linenos)) {
14920
+ self.lineno = $rb_plus(self.lineno, 1)};
14792
14921
  return front_matter;
14793
14922
  }, $PreprocessorReader_skip_front_matter$excl$84.$$arity = -2);
14794
14923
  return (Opal.def(self, '$resolve_expr_val', $PreprocessorReader_resolve_expr_val$85 = function $$resolve_expr_val(val) {
@@ -15208,7 +15337,7 @@ Opal.modules["asciidoctor/table"] = function(Opal) {
15208
15337
  }
15209
15338
  var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $hash2 = Opal.hash2, $send = Opal.send, $truthy = Opal.truthy, $gvars = Opal.gvars;
15210
15339
 
15211
- Opal.add_stubs(['$attr_accessor', '$attr_reader', '$new', '$[]', '$>', '$to_i', '$<', '$==', '$[]=', '$-', '$attributes', '$truncate', '$*', '$/', '$to_f', '$empty?', '$body', '$each', '$<<', '$size', '$+', '$assign_column_widths', '$warn', '$logger', '$update_attributes', '$assign_width', '$round', '$map', '$shift', '$reinitialize', '$head=', '$nil?', '$unshift', '$pop', '$foot=', '$parent', '$sourcemap', '$dup', '$header_row?', '$table', '$style', '$merge', '$delete', '$===', '$start_with?', '$rstrip', '$slice', '$length', '$advance', '$lstrip', '$strip', '$split', '$include?', '$readlines', '$catalog_inline_anchor', '$=~', '$apply_subs', '$attr_writer', '$convert', '$text', '$!=', '$file', '$lineno', '$include', '$to_set', '$mark', '$key?', '$nested?', '$document', '$error', '$message_with_context', '$cursor_at_prev_line', '$nil_or_empty?', '$escape', '$columns', '$match', '$chop', '$end_with?', '$gsub', '$!', '$push_cellspec', '$cell_open?', '$close_cell', '$take_cellspec', '$squeeze', '$upto', '$times', '$cursor_before_mark', '$rowspan', '$activate_rowspan', '$colspan', '$end_of_row?', '$close_row', '$private', '$rows', '$effective_column_visits']);
15340
+ Opal.add_stubs(['$attr_accessor', '$attr_reader', '$new', '$[]', '$>', '$to_i', '$<', '$==', '$[]=', '$-', '$attributes', '$truncate', '$*', '$/', '$to_f', '$empty?', '$body', '$each', '$<<', '$size', '$+', '$assign_column_widths', '$warn', '$logger', '$update_attributes', '$assign_width', '$round', '$map', '$shift', '$reinitialize', '$head=', '$nil?', '$unshift', '$pop', '$foot=', '$parent', '$sourcemap', '$dup', '$header_row?', '$table', '$style', '$merge', '$delete', '$===', '$start_with?', '$rstrip', '$slice', '$length', '$advance', '$lstrip', '$strip', '$split', '$include?', '$readlines', '$catalog_inline_anchor', '$=~', '$apply_subs', '$attr_writer', '$convert', '$text', '$!=', '$file', '$lineno', '$include', '$to_set', '$mark', '$key?', '$nested?', '$document', '$error', '$message_with_context', '$cursor_at_prev_line', '$nil_or_empty?', '$escape', '$columns', '$match', '$chop', '$end_with?', '$gsub', '$!', '$push_cellspec', '$cell_open?', '$close_cell', '$take_cellspec', '$squeeze', '$upto', '$times', '$cursor_before_mark', '$rowspan', '$activate_rowspan', '$colspan', '$end_of_row?', '$close_row', '$private', '$rows', '$<=>', '$effective_column_visits']);
15212
15341
  return (function($base, $parent_nesting) {
15213
15342
  var self = $module($base, 'Asciidoctor');
15214
15343
 
@@ -15624,7 +15753,7 @@ Opal.modules["asciidoctor/table"] = function(Opal) {
15624
15753
  if ($truthy(inner_document_lines['$empty?']())) {
15625
15754
  } else if ($truthy((unprocessed_line1 = inner_document_lines['$[]'](0))['$include?']("::"))) {
15626
15755
 
15627
- preprocessed_lines = $$($nesting, 'PreprocessorReader').$new(self.document, [unprocessed_line1]).$readlines();
15756
+ preprocessed_lines = $$($nesting, 'PreprocessorReader').$new(self.document, [unprocessed_line1], inner_document_cursor).$readlines();
15628
15757
  if ($truthy((($a = unprocessed_line1['$=='](preprocessed_lines['$[]'](0))) ? $rb_lt(preprocessed_lines.$size(), 2) : unprocessed_line1['$=='](preprocessed_lines['$[]'](0))))) {
15629
15758
  } else {
15630
15759
 
@@ -15772,9 +15901,9 @@ Opal.modules["asciidoctor/table"] = function(Opal) {
15772
15901
  (function($base, $super, $parent_nesting) {
15773
15902
  var self = $klass($base, $super, 'ParserContext');
15774
15903
 
15775
- var $nesting = [self].concat($parent_nesting), $ParserContext_initialize$30, $ParserContext_starts_with_delimiter$ques$31, $ParserContext_match_delimiter$32, $ParserContext_skip_past_delimiter$33, $ParserContext_skip_past_escaped_delimiter$34, $ParserContext_buffer_has_unclosed_quotes$ques$35, $ParserContext_take_cellspec$36, $ParserContext_push_cellspec$37, $ParserContext_keep_cell_open$38, $ParserContext_mark_cell_closed$39, $ParserContext_cell_open$ques$40, $ParserContext_cell_closed$ques$41, $ParserContext_close_open_cell$42, $ParserContext_close_cell$43, $ParserContext_close_row$46, $ParserContext_activate_rowspan$47, $ParserContext_end_of_row$ques$49, $ParserContext_effective_column_visits$50, $ParserContext_advance$51;
15904
+ var $nesting = [self].concat($parent_nesting), $ParserContext_initialize$30, $ParserContext_starts_with_delimiter$ques$31, $ParserContext_match_delimiter$32, $ParserContext_skip_past_delimiter$33, $ParserContext_skip_past_escaped_delimiter$34, $ParserContext_buffer_has_unclosed_quotes$ques$35, $ParserContext_take_cellspec$36, $ParserContext_push_cellspec$37, $ParserContext_keep_cell_open$38, $ParserContext_mark_cell_closed$39, $ParserContext_cell_open$ques$40, $ParserContext_cell_closed$ques$41, $ParserContext_close_open_cell$42, $ParserContext_close_cell$43, $ParserContext_close_table$46, $ParserContext_close_row$47, $ParserContext_activate_rowspan$48, $ParserContext_end_of_row$ques$50, $ParserContext_effective_column_visits$51, $ParserContext_advance$52;
15776
15905
 
15777
- self.$$prototype.delimiter = self.$$prototype.delimiter_rx = self.$$prototype.buffer = self.$$prototype.cellspecs = self.$$prototype.cell_open = self.$$prototype.format = self.$$prototype.start_cursor_data = self.$$prototype.reader = self.$$prototype.table = self.$$prototype.current_row = self.$$prototype.colcount = self.$$prototype.column_visits = self.$$prototype.active_rowspans = self.$$prototype.linenum = nil;
15906
+ self.$$prototype.delimiter = self.$$prototype.delimiter_rx = self.$$prototype.buffer = self.$$prototype.cellspecs = self.$$prototype.cell_open = self.$$prototype.format = self.$$prototype.start_cursor_data = self.$$prototype.reader = self.$$prototype.column_visits = self.$$prototype.table = self.$$prototype.current_row = self.$$prototype.colcount = self.$$prototype.active_rowspans = self.$$prototype.linenum = nil;
15778
15907
 
15779
15908
  self.$include($$($nesting, 'Logging'));
15780
15909
  Opal.const_set($nesting[0], 'FORMATS', ["psv", "csv", "dsv", "tsv"].$to_set());
@@ -15963,8 +16092,7 @@ Opal.modules["asciidoctor/table"] = function(Opal) {
15963
16092
  return nil;
15964
16093
  }, $ParserContext_close_open_cell$42.$$arity = -1);
15965
16094
 
15966
- Opal.def(self, '$close_cell', $ParserContext_close_cell$43 = function $$close_cell(eol) {try {
15967
-
16095
+ Opal.def(self, '$close_cell', $ParserContext_close_cell$43 = function $$close_cell(eol) {
15968
16096
  var $a, $b, $$44, self = this, cell_text = nil, cellspec = nil, repeat = nil, q = nil;
15969
16097
 
15970
16098
 
@@ -16003,7 +16131,7 @@ Opal.modules["asciidoctor/table"] = function(Opal) {
16003
16131
  cell_text = cell_text.$squeeze(q)
16004
16132
  }};
16005
16133
  };
16006
- $send((1), 'upto', [repeat], ($$44 = function(i){var self = $$44.$$s || this, $c, $d, $$45, $e, column = nil, extra_cols = nil, offset = nil, cell = nil;
16134
+ $send((1), 'upto', [repeat], ($$44 = function(i){var self = $$44.$$s || this, $c, $d, $$45, $e, column = nil, extra_cols = nil, offset = nil, cell = nil, cursor_before_mark = nil, row_status = nil;
16007
16135
  if (self.colcount == null) self.colcount = nil;
16008
16136
  if (self.table == null) self.table = nil;
16009
16137
  if (self.current_row == null) self.current_row = nil;
@@ -16031,13 +16159,10 @@ Opal.modules["asciidoctor/table"] = function(Opal) {
16031
16159
  j = nil;
16032
16160
  };
16033
16161
  return self.table.$columns()['$<<']($$$($$($nesting, 'Table'), 'Column').$new(self.table, $rb_plus(offset, j)));}, $$45.$$s = self, $$45.$$arity = 1, $$45));};
16034
- } else if ($truthy((column = self.table.$columns()['$[]'](self.current_row.$size())))) {
16035
16162
  } else {
16036
-
16037
- self.$logger().$error(self.$message_with_context("dropping cell because it exceeds specified number of columns", $hash2(["source_location"], {"source_location": self.reader.$cursor_before_mark()})));
16038
- Opal.ret(nil);
16163
+ column = self.table.$columns()['$[]'](self.current_row.$size())
16039
16164
  };
16040
- cell = $$$($$($nesting, 'Table'), 'Cell').$new(column, cell_text, cellspec, $hash2(["cursor"], {"cursor": self.reader.$cursor_before_mark()}));
16165
+ cell = $$$($$($nesting, 'Table'), 'Cell').$new(column, cell_text, cellspec, $hash2(["cursor"], {"cursor": (cursor_before_mark = self.reader.$cursor_before_mark())}));
16041
16166
  self.reader.$mark();
16042
16167
  if ($truthy(($truthy($c = cell.$rowspan()['$!']()) ? $c : cell.$rowspan()['$=='](1)))) {
16043
16168
  } else {
@@ -16045,22 +16170,44 @@ Opal.modules["asciidoctor/table"] = function(Opal) {
16045
16170
  };
16046
16171
  self.column_visits = $rb_plus(self.column_visits, ($truthy($c = cell.$colspan()) ? $c : 1));
16047
16172
  self.current_row['$<<'](cell);
16048
- if ($truthy(($truthy($c = self['$end_of_row?']()) ? ($truthy($d = ($truthy($e = self.colcount['$!='](-1)) ? $e : $rb_gt(self.linenum, 0))) ? $d : ($truthy($e = eol) ? i['$=='](repeat) : $e)) : $c))) {
16049
- return self.$close_row()
16173
+ if ($truthy(($truthy($c = $rb_gt((row_status = self['$end_of_row?']()), -1)) ? ($truthy($d = ($truthy($e = self.colcount['$!='](-1)) ? $e : $rb_gt(self.linenum, 0))) ? $d : ($truthy($e = eol) ? i['$=='](repeat) : $e)) : $c))) {
16174
+ if ($truthy($rb_gt(row_status, 0))) {
16175
+
16176
+ self.$logger().$error(self.$message_with_context("dropping cell because it exceeds specified number of columns", $hash2(["source_location"], {"source_location": cursor_before_mark})));
16177
+ return self.$close_row(true);
16178
+ } else {
16179
+ return self.$close_row()
16180
+ }
16050
16181
  } else {
16051
16182
  return nil
16052
16183
  };}, $$44.$$s = self, $$44.$$arity = 1, $$44));
16053
16184
  self.cell_open = false;
16054
16185
  return nil;
16055
- } catch ($returner) { if ($returner === Opal.returner) { return $returner.$v } throw $returner; }
16056
16186
  }, $ParserContext_close_cell$43.$$arity = -1);
16187
+
16188
+ Opal.def(self, '$close_table', $ParserContext_close_table$46 = function $$close_table() {
16189
+ var self = this;
16190
+
16191
+
16192
+ if (self.column_visits['$=='](0)) {
16193
+ return nil};
16194
+ self.$logger().$error(self.$message_with_context("dropping cells from incomplete row detected end of table", $hash2(["source_location"], {"source_location": self.reader.$cursor_before_mark()})));
16195
+ return nil;
16196
+ }, $ParserContext_close_table$46.$$arity = 0);
16057
16197
  self.$private();
16058
16198
 
16059
- Opal.def(self, '$close_row', $ParserContext_close_row$46 = function $$close_row() {
16199
+ Opal.def(self, '$close_row', $ParserContext_close_row$47 = function $$close_row(drop) {
16060
16200
  var $a, self = this, $writer = nil;
16061
16201
 
16062
16202
 
16063
- self.table.$rows().$body()['$<<'](self.current_row);
16203
+
16204
+ if (drop == null) {
16205
+ drop = false;
16206
+ };
16207
+ if ($truthy(drop)) {
16208
+ } else {
16209
+ self.table.$rows().$body()['$<<'](self.current_row)
16210
+ };
16064
16211
  if (self.colcount['$=='](-1)) {
16065
16212
  self.colcount = self.column_visits};
16066
16213
  self.column_visits = 0;
@@ -16068,13 +16215,13 @@ Opal.modules["asciidoctor/table"] = function(Opal) {
16068
16215
  self.active_rowspans.$shift();
16069
16216
  ($truthy($a = self.active_rowspans['$[]'](0)) ? $a : (($writer = [0, 0]), $send(self.active_rowspans, '[]=', Opal.to_a($writer)), $writer[$rb_minus($writer["length"], 1)]));
16070
16217
  return nil;
16071
- }, $ParserContext_close_row$46.$$arity = 0);
16218
+ }, $ParserContext_close_row$47.$$arity = -1);
16072
16219
 
16073
- Opal.def(self, '$activate_rowspan', $ParserContext_activate_rowspan$47 = function $$activate_rowspan(rowspan, colspan) {
16074
- var $$48, self = this;
16220
+ Opal.def(self, '$activate_rowspan', $ParserContext_activate_rowspan$48 = function $$activate_rowspan(rowspan, colspan) {
16221
+ var $$49, self = this;
16075
16222
 
16076
16223
 
16077
- $send((1), 'upto', [$rb_minus(rowspan, 1)], ($$48 = function(i){var self = $$48.$$s || this, $a, $writer = nil;
16224
+ $send((1), 'upto', [$rb_minus(rowspan, 1)], ($$49 = function(i){var self = $$49.$$s || this, $a, $writer = nil;
16078
16225
  if (self.active_rowspans == null) self.active_rowspans = nil;
16079
16226
 
16080
16227
 
@@ -16084,26 +16231,30 @@ Opal.modules["asciidoctor/table"] = function(Opal) {
16084
16231
  };
16085
16232
  $writer = [i, $rb_plus(($truthy($a = self.active_rowspans['$[]'](i)) ? $a : 0), colspan)];
16086
16233
  $send(self.active_rowspans, '[]=', Opal.to_a($writer));
16087
- return $writer[$rb_minus($writer["length"], 1)];}, $$48.$$s = self, $$48.$$arity = 1, $$48));
16234
+ return $writer[$rb_minus($writer["length"], 1)];}, $$49.$$s = self, $$49.$$arity = 1, $$49));
16088
16235
  return nil;
16089
- }, $ParserContext_activate_rowspan$47.$$arity = 2);
16236
+ }, $ParserContext_activate_rowspan$48.$$arity = 2);
16090
16237
 
16091
- Opal.def(self, '$end_of_row?', $ParserContext_end_of_row$ques$49 = function() {
16092
- var $a, self = this;
16238
+ Opal.def(self, '$end_of_row?', $ParserContext_end_of_row$ques$50 = function() {
16239
+ var self = this;
16093
16240
 
16094
- return ($truthy($a = self.colcount['$=='](-1)) ? $a : self.$effective_column_visits()['$=='](self.colcount))
16095
- }, $ParserContext_end_of_row$ques$49.$$arity = 0);
16241
+ if (self.colcount['$=='](-1)) {
16242
+ return 0
16243
+ } else {
16244
+ return self.$effective_column_visits()['$<=>'](self.colcount)
16245
+ }
16246
+ }, $ParserContext_end_of_row$ques$50.$$arity = 0);
16096
16247
 
16097
- Opal.def(self, '$effective_column_visits', $ParserContext_effective_column_visits$50 = function $$effective_column_visits() {
16248
+ Opal.def(self, '$effective_column_visits', $ParserContext_effective_column_visits$51 = function $$effective_column_visits() {
16098
16249
  var self = this;
16099
16250
 
16100
16251
  return $rb_plus(self.column_visits, self.active_rowspans['$[]'](0))
16101
- }, $ParserContext_effective_column_visits$50.$$arity = 0);
16102
- return (Opal.def(self, '$advance', $ParserContext_advance$51 = function $$advance() {
16252
+ }, $ParserContext_effective_column_visits$51.$$arity = 0);
16253
+ return (Opal.def(self, '$advance', $ParserContext_advance$52 = function $$advance() {
16103
16254
  var self = this;
16104
16255
 
16105
16256
  return (self.linenum = $rb_plus(self.linenum, 1))
16106
- }, $ParserContext_advance$51.$$arity = 0), nil) && 'advance';
16257
+ }, $ParserContext_advance$52.$$arity = 0), nil) && 'advance';
16107
16258
  })($$($nesting, 'Table'), null, $nesting);
16108
16259
  })($nesting[0], $nesting)
16109
16260
  };
@@ -16670,7 +16821,7 @@ Opal.modules["asciidoctor/syntax_highlighter/highlightjs"] = function(Opal) {
16670
16821
  return "" + "<script src=\"" + (base_url) + "/languages/" + (lang.$lstrip()) + ".min.js\"></script>\n";}, $$6.$$s = self, $$6.$$arity = 1, $$6)).$join()
16671
16822
  } else {
16672
16823
  return ""
16673
- }; return nil; })()) + "<script>\n" + "if (!hljs.initHighlighting.called) {\n" + " hljs.initHighlighting.called = true\n" + " ;[].slice.call(document.querySelectorAll('pre.highlight > code')).forEach(function (el) { hljs.highlightBlock(el) })\n" + "}\n" + "</script>"
16824
+ }; return nil; })()) + "<script>\n" + "if (!hljs.initHighlighting.called) {\n" + " hljs.initHighlighting.called = true\n" + " ;[].slice.call(document.querySelectorAll('pre.highlight > code[data-lang]')).forEach(function (el) { hljs.highlightBlock(el) })\n" + "}\n" + "</script>"
16674
16825
  };
16675
16826
  }, $HighlightJsAdapter_docinfo$5.$$arity = 3), nil) && 'docinfo';
16676
16827
  })($$($nesting, 'SyntaxHighlighter'), $$$($$($nesting, 'SyntaxHighlighter'), 'Base'), $nesting)
@@ -18238,7 +18389,7 @@ Opal.modules["asciidoctor/converter/html5"] = function(Opal) {
18238
18389
 
18239
18390
  return syntax_hl.$format(node, lang, opts);
18240
18391
  } else {
18241
- return $rb_plus($rb_plus(pre_open, ($truthy($a = node.$content()) ? $a : "")), pre_close)
18392
+ return $rb_plus($rb_plus(pre_open, node.$content()), pre_close)
18242
18393
  }; return nil; })()) + "\n" + "</div>\n" + "</div>";
18243
18394
  }, $Html5Converter_convert_listing$26.$$arity = 1);
18244
18395
 
@@ -18370,7 +18521,7 @@ Opal.modules["asciidoctor/converter/html5"] = function(Opal) {
18370
18521
  if ((style = node.$style())['$==']("abstract")) {
18371
18522
  if ($truthy((($a = node.$parent()['$=='](node.$document())) ? node.$document().$doctype()['$==']("book") : node.$parent()['$=='](node.$document())))) {
18372
18523
 
18373
- self.$logger().$warn("abstract block cannot be used in a document without a title when doctype is book. Excluding block content.");
18524
+ self.$logger().$warn("abstract block cannot be used in a document without a doctitle when doctype is book. Excluding block content.");
18374
18525
  return "";
18375
18526
  } else {
18376
18527
 
@@ -19452,7 +19603,7 @@ Opal.modules["asciidoctor/extensions"] = function(Opal) {
19452
19603
  }
19453
19604
  var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.const_get_qualified, $$ = Opal.const_get_relative, $breaker = Opal.breaker, $slice = Opal.slice, $module = Opal.module, $klass = Opal.klass, $truthy = Opal.truthy, $hash2 = Opal.hash2, $send = Opal.send, $hash = Opal.hash;
19454
19605
 
19455
- Opal.add_stubs(['$==', '$[]=', '$config', '$-', '$const_defined?', '$singleton_class?', '$include', '$const_get', '$extend', '$attr_reader', '$merge', '$class', '$update', '$raise', '$document', '$doctype', '$[]', '$+', '$level', '$delete', '$>', '$casecmp', '$new', '$title=', '$sectname=', '$special=', '$fetch', '$numbered=', '$!', '$key?', '$attr?', '$special', '$numbered', '$generate_id', '$title', '$id=', '$update_attributes', '$tr', '$basename', '$create_block', '$assign_caption', '$===', '$parse_blocks', '$empty?', '$include?', '$sub_attributes', '$parse', '$each', '$define_method', '$unshift', '$shift', '$send', '$size', '$binding', '$receiver', '$define_singleton_method', '$instance_exec', '$to_proc', '$call', '$option', '$flatten', '$respond_to?', '$to_s', '$partition', '$to_i', '$<<', '$compact', '$inspect', '$attr_accessor', '$to_set', '$match?', '$resolve_regexp', '$method', '$register', '$values', '$groups', '$arity', '$activate', '$add_document_processor', '$any?', '$select', '$add_syntax_processor', '$to_sym', '$instance_variable_get', '$kind', '$private', '$join', '$map', '$split', '$capitalize', '$instance_variable_set', '$resolve_args', '$enable_dsl', '$singleton_class', '$process_block_given?', '$source_location', '$freeze', '$resolve_class', '$<', '$update_config', '$as_symbol', '$name', '$name=', '$pop', '$-@', '$next_auto_id', '$generate_name']);
19606
+ Opal.add_stubs(['$==', '$[]=', '$config', '$-', '$const_defined?', '$singleton_class?', '$include', '$const_get', '$extend', '$attr_reader', '$merge', '$class', '$update', '$raise', '$document', '$doctype', '$[]', '$+', '$level', '$delete', '$>', '$casecmp', '$new', '$title=', '$sectname=', '$special=', '$fetch', '$numbered=', '$!', '$key?', '$attr?', '$special', '$numbered', '$generate_id', '$title', '$id=', '$update_attributes', '$tr', '$basename', '$create_block', '$assign_caption', '$===', '$parse_blocks', '$empty?', '$include?', '$sub_attributes', '$parse', '$each', '$define_method', '$unshift', '$shift', '$send', '$size', '$binding', '$receiver', '$define_singleton_method', '$instance_exec', '$to_proc', '$call', '$option', '$flatten', '$respond_to?', '$to_s', '$partition', '$to_i', '$<<', '$compact', '$inspect', '$attr_accessor', '$to_set', '$match?', '$resolve_regexp', '$method', '$register', '$reset', '$values', '$groups', '$arity', '$activate', '$add_document_processor', '$any?', '$select', '$add_syntax_processor', '$to_sym', '$instance_variable_get', '$kind', '$private', '$join', '$map', '$split', '$capitalize', '$instance_variable_set', '$resolve_args', '$enable_dsl', '$singleton_class', '$process_block_given?', '$source_location', '$freeze', '$resolve_class', '$<', '$update_config', '$as_symbol', '$name', '$name=', '$pop', '$-@', '$next_auto_id', '$generate_name', '$each_with_object']);
19456
19607
 
19457
19608
  if ($$($nesting, 'RUBY_ENGINE')['$==']("opal")) {
19458
19609
  } else {
@@ -20390,9 +20541,9 @@ Opal.modules["asciidoctor/extensions"] = function(Opal) {
20390
20541
  (function($base, $super, $parent_nesting) {
20391
20542
  var self = $klass($base, $super, 'Registry');
20392
20543
 
20393
- var $nesting = [self].concat($parent_nesting), $Registry_initialize$53, $Registry_activate$54, $Registry_preprocessor$56, $Registry_preprocessors$ques$57, $Registry_preprocessors$58, $Registry_tree_processor$59, $Registry_tree_processors$ques$60, $Registry_tree_processors$61, $Registry_postprocessor$62, $Registry_postprocessors$ques$63, $Registry_postprocessors$64, $Registry_include_processor$65, $Registry_include_processors$ques$66, $Registry_include_processors$67, $Registry_docinfo_processor$68, $Registry_docinfo_processors$ques$69, $Registry_docinfo_processors$71, $Registry_block$73, $Registry_blocks$ques$74, $Registry_registered_for_block$ques$75, $Registry_find_block_extension$76, $Registry_block_macro$77, $Registry_block_macros$ques$78, $Registry_registered_for_block_macro$ques$79, $Registry_find_block_macro_extension$80, $Registry_inline_macro$81, $Registry_inline_macros$ques$82, $Registry_registered_for_inline_macro$ques$83, $Registry_find_inline_macro_extension$84, $Registry_inline_macros$85, $Registry_prefer$86, $Registry_add_document_processor$87, $Registry_add_syntax_processor$89, $Registry_resolve_args$91, $Registry_as_symbol$92;
20544
+ var $nesting = [self].concat($parent_nesting), $Registry_initialize$53, $Registry_activate$54, $Registry_preprocessor$56, $Registry_preprocessors$ques$57, $Registry_preprocessors$58, $Registry_tree_processor$59, $Registry_tree_processors$ques$60, $Registry_tree_processors$61, $Registry_postprocessor$62, $Registry_postprocessors$ques$63, $Registry_postprocessors$64, $Registry_include_processor$65, $Registry_include_processors$ques$66, $Registry_include_processors$67, $Registry_docinfo_processor$68, $Registry_docinfo_processors$ques$69, $Registry_docinfo_processors$71, $Registry_block$73, $Registry_blocks$ques$74, $Registry_registered_for_block$ques$75, $Registry_find_block_extension$76, $Registry_block_macro$77, $Registry_block_macros$ques$78, $Registry_registered_for_block_macro$ques$79, $Registry_find_block_macro_extension$80, $Registry_inline_macro$81, $Registry_inline_macros$ques$82, $Registry_registered_for_inline_macro$ques$83, $Registry_find_inline_macro_extension$84, $Registry_inline_macros$85, $Registry_prefer$86, $Registry_add_document_processor$87, $Registry_add_syntax_processor$89, $Registry_reset$91, $Registry_resolve_args$92, $Registry_as_symbol$93;
20394
20545
 
20395
- self.$$prototype.groups = self.$$prototype.preprocessor_extensions = self.$$prototype.tree_processor_extensions = self.$$prototype.postprocessor_extensions = self.$$prototype.include_processor_extensions = self.$$prototype.docinfo_processor_extensions = self.$$prototype.block_extensions = self.$$prototype.block_macro_extensions = self.$$prototype.inline_macro_extensions = nil;
20546
+ self.$$prototype.document = self.$$prototype.groups = self.$$prototype.preprocessor_extensions = self.$$prototype.tree_processor_extensions = self.$$prototype.postprocessor_extensions = self.$$prototype.include_processor_extensions = self.$$prototype.docinfo_processor_extensions = self.$$prototype.block_extensions = self.$$prototype.block_macro_extensions = self.$$prototype.inline_macro_extensions = nil;
20396
20547
 
20397
20548
  self.$attr_reader("document");
20398
20549
  self.$attr_reader("groups");
@@ -20406,6 +20557,7 @@ Opal.modules["asciidoctor/extensions"] = function(Opal) {
20406
20557
  groups = $hash2([], {});
20407
20558
  };
20408
20559
  self.groups = groups;
20560
+ self.$reset();
20409
20561
  self.preprocessor_extensions = (self.tree_processor_extensions = (self.postprocessor_extensions = (self.include_processor_extensions = (self.docinfo_processor_extensions = (self.block_extensions = (self.block_macro_extensions = (self.inline_macro_extensions = nil)))))));
20410
20562
  return (self.document = nil);
20411
20563
  }, $Registry_initialize$53.$$arity = -1);
@@ -20414,6 +20566,8 @@ Opal.modules["asciidoctor/extensions"] = function(Opal) {
20414
20566
  var $$55, self = this, ext_groups = nil;
20415
20567
 
20416
20568
 
20569
+ if ($truthy(self.document)) {
20570
+ self.$reset()};
20417
20571
  self.document = document;
20418
20572
  if ($truthy((ext_groups = $rb_plus($$($nesting, 'Extensions').$groups().$values(), self.groups.$values()))['$empty?']())) {
20419
20573
  } else {
@@ -20784,7 +20938,7 @@ Opal.modules["asciidoctor/extensions"] = function(Opal) {
20784
20938
  };
20785
20939
  if ($truthy(processor['$process_block_given?']())) {
20786
20940
  } else {
20787
- self.$raise($$$('::', 'ArgumentError'), "" + "No block specified to process " + (kind_name) + " extension at " + (block.$source_location()))
20941
+ self.$raise($$$('::', 'NoMethodError'), "" + "No block specified to process " + (kind_name) + " extension at " + (block.$source_location().$join(":")))
20788
20942
  };
20789
20943
  processor.$freeze();
20790
20944
  extension = $$($nesting, 'ProcessorExtension').$new(kind, processor);
@@ -20854,11 +21008,11 @@ Opal.modules["asciidoctor/extensions"] = function(Opal) {
20854
21008
  };
20855
21009
  if ($truthy((name = self.$as_symbol(processor.$name())))) {
20856
21010
  } else {
20857
- self.$raise($$$('::', 'ArgumentError'), "" + "No name specified for " + (kind_name) + " extension at " + (block.$source_location()))
21011
+ self.$raise($$$('::', 'ArgumentError'), "" + "No name specified for " + (kind_name) + " extension at " + (block.$source_location().$join(":")))
20858
21012
  };
20859
21013
  if ($truthy(processor['$process_block_given?']())) {
20860
21014
  } else {
20861
- self.$raise($$$('::', 'NoMethodError'), "" + "No block specified to process " + (kind_name) + " extension at " + (block.$source_location()))
21015
+ self.$raise($$$('::', 'NoMethodError'), "" + "No block specified to process " + (kind_name) + " extension at " + (block.$source_location().$join(":")))
20862
21016
  };
20863
21017
  processor.$freeze();
20864
21018
 
@@ -20911,7 +21065,15 @@ Opal.modules["asciidoctor/extensions"] = function(Opal) {
20911
21065
  };
20912
21066
  }, $Registry_add_syntax_processor$89.$$arity = 2);
20913
21067
 
20914
- Opal.def(self, '$resolve_args', $Registry_resolve_args$91 = function $$resolve_args(args, expect) {
21068
+ Opal.def(self, '$reset', $Registry_reset$91 = function $$reset() {
21069
+ var self = this;
21070
+
21071
+
21072
+ self.preprocessor_extensions = (self.tree_processor_extensions = (self.postprocessor_extensions = (self.include_processor_extensions = (self.docinfo_processor_extensions = (self.block_extensions = (self.block_macro_extensions = (self.inline_macro_extensions = nil)))))));
21073
+ return (self.document = nil);
21074
+ }, $Registry_reset$91.$$arity = 0);
21075
+
21076
+ Opal.def(self, '$resolve_args', $Registry_resolve_args$92 = function $$resolve_args(args, expect) {
20915
21077
  var self = this, opts = nil, missing = nil;
20916
21078
 
20917
21079
 
@@ -20928,8 +21090,8 @@ Opal.modules["asciidoctor/extensions"] = function(Opal) {
20928
21090
  args.$pop(missing['$-@']())};
20929
21091
  args['$<<'](opts);
20930
21092
  return args;
20931
- }, $Registry_resolve_args$91.$$arity = 2);
20932
- return (Opal.def(self, '$as_symbol', $Registry_as_symbol$92 = function $$as_symbol(name) {
21093
+ }, $Registry_resolve_args$92.$$arity = 2);
21094
+ return (Opal.def(self, '$as_symbol', $Registry_as_symbol$93 = function $$as_symbol(name) {
20933
21095
  var self = this;
20934
21096
 
20935
21097
  if ($truthy(name)) {
@@ -20937,42 +21099,42 @@ Opal.modules["asciidoctor/extensions"] = function(Opal) {
20937
21099
  } else {
20938
21100
  return nil
20939
21101
  }
20940
- }, $Registry_as_symbol$92.$$arity = 1), nil) && 'as_symbol';
21102
+ }, $Registry_as_symbol$93.$$arity = 1), nil) && 'as_symbol';
20941
21103
  })($nesting[0], null, $nesting);
20942
21104
  (function(self, $parent_nesting) {
20943
- var $nesting = [self].concat($parent_nesting), $generate_name$93, $next_auto_id$94, $groups$95, $create$96, $register$97, $unregister_all$98, $unregister$99;
21105
+ var $nesting = [self].concat($parent_nesting), $generate_name$94, $next_auto_id$95, $groups$96, $create$97, $register$98, $unregister_all$99, $unregister$100;
20944
21106
 
20945
21107
 
20946
21108
 
20947
- Opal.def(self, '$generate_name', $generate_name$93 = function $$generate_name() {
21109
+ Opal.def(self, '$generate_name', $generate_name$94 = function $$generate_name() {
20948
21110
  var self = this;
20949
21111
 
20950
21112
  return "" + "extgrp" + (self.$next_auto_id())
20951
- }, $generate_name$93.$$arity = 0);
21113
+ }, $generate_name$94.$$arity = 0);
20952
21114
 
20953
- Opal.def(self, '$next_auto_id', $next_auto_id$94 = function $$next_auto_id() {
21115
+ Opal.def(self, '$next_auto_id', $next_auto_id$95 = function $$next_auto_id() {
20954
21116
  var $a, self = this;
20955
21117
  if (self.auto_id == null) self.auto_id = nil;
20956
21118
 
20957
21119
 
20958
21120
  self.auto_id = ($truthy($a = self.auto_id) ? $a : -1);
20959
21121
  return (self.auto_id = $rb_plus(self.auto_id, 1));
20960
- }, $next_auto_id$94.$$arity = 0);
21122
+ }, $next_auto_id$95.$$arity = 0);
20961
21123
 
20962
- Opal.def(self, '$groups', $groups$95 = function $$groups() {
21124
+ Opal.def(self, '$groups', $groups$96 = function $$groups() {
20963
21125
  var $a, self = this;
20964
21126
  if (self.groups == null) self.groups = nil;
20965
21127
 
20966
21128
  return (self.groups = ($truthy($a = self.groups) ? $a : $hash2([], {})))
20967
- }, $groups$95.$$arity = 0);
21129
+ }, $groups$96.$$arity = 0);
20968
21130
 
20969
- Opal.def(self, '$create', $create$96 = function $$create(name) {
20970
- var $iter = $create$96.$$p, block = $iter || nil, $a, self = this;
21131
+ Opal.def(self, '$create', $create$97 = function $$create(name) {
21132
+ var $iter = $create$97.$$p, block = $iter || nil, $a, self = this;
20971
21133
 
20972
- if ($iter) $create$96.$$p = null;
21134
+ if ($iter) $create$97.$$p = null;
20973
21135
 
20974
21136
 
20975
- if ($iter) $create$96.$$p = null;;
21137
+ if ($iter) $create$97.$$p = null;;
20976
21138
 
20977
21139
  if (name == null) {
20978
21140
  name = nil;
@@ -20982,15 +21144,15 @@ Opal.modules["asciidoctor/extensions"] = function(Opal) {
20982
21144
  } else {
20983
21145
  return $$($nesting, 'Registry').$new()
20984
21146
  };
20985
- }, $create$96.$$arity = -1);
21147
+ }, $create$97.$$arity = -1);
20986
21148
 
20987
- Opal.def(self, '$register', $register$97 = function $$register($a) {
20988
- var $iter = $register$97.$$p, block = $iter || nil, $post_args, args, $b, self = this, argc = nil, resolved_group = nil, group = nil, name = nil, $writer = nil;
21149
+ Opal.def(self, '$register', $register$98 = function $$register($a) {
21150
+ var $iter = $register$98.$$p, block = $iter || nil, $post_args, args, $b, self = this, argc = nil, resolved_group = nil, group = nil, name = nil, $writer = nil;
20989
21151
 
20990
- if ($iter) $register$97.$$p = null;
21152
+ if ($iter) $register$98.$$p = null;
20991
21153
 
20992
21154
 
20993
- if ($iter) $register$97.$$p = null;;
21155
+ if ($iter) $register$98.$$p = null;;
20994
21156
 
20995
21157
  $post_args = Opal.slice.call(arguments, 0, arguments.length);
20996
21158
 
@@ -21012,34 +21174,37 @@ Opal.modules["asciidoctor/extensions"] = function(Opal) {
21012
21174
  $writer = [name.$to_sym(), resolved_group];
21013
21175
  $send(self.$groups(), '[]=', Opal.to_a($writer));
21014
21176
  return $writer[$rb_minus($writer["length"], 1)];;
21015
- }, $register$97.$$arity = -1);
21177
+ }, $register$98.$$arity = -1);
21016
21178
 
21017
- Opal.def(self, '$unregister_all', $unregister_all$98 = function $$unregister_all() {
21179
+ Opal.def(self, '$unregister_all', $unregister_all$99 = function $$unregister_all() {
21018
21180
  var self = this;
21019
21181
 
21020
21182
 
21021
21183
  self.groups = $hash2([], {});
21022
21184
  return nil;
21023
- }, $unregister_all$98.$$arity = 0);
21024
- return (Opal.def(self, '$unregister', $unregister$99 = function $$unregister($a) {
21025
- var $post_args, names, $$100, self = this;
21185
+ }, $unregister_all$99.$$arity = 0);
21186
+ return (Opal.def(self, '$unregister', $unregister$100 = function $$unregister($a) {
21187
+ var $post_args, names, $$101, self = this;
21026
21188
 
21027
21189
 
21028
21190
 
21029
21191
  $post_args = Opal.slice.call(arguments, 0, arguments.length);
21030
21192
 
21031
21193
  names = $post_args;;
21032
- $send(names, 'each', [], ($$100 = function(group){var self = $$100.$$s || this;
21033
- if (self.groups == null) self.groups = nil;
21194
+ $send(names, 'each_with_object', [self.$groups()], ($$101 = function(group, catalog){var self = $$101.$$s || this;
21034
21195
 
21035
21196
 
21036
21197
 
21037
21198
  if (group == null) {
21038
21199
  group = nil;
21039
21200
  };
21040
- return self.groups.$delete(group.$to_sym());}, $$100.$$s = self, $$100.$$arity = 1, $$100));
21201
+
21202
+ if (catalog == null) {
21203
+ catalog = nil;
21204
+ };
21205
+ return catalog.$delete(group.$to_sym());}, $$101.$$s = self, $$101.$$arity = 2, $$101));
21041
21206
  return nil;
21042
- }, $unregister$99.$$arity = -1), nil) && 'unregister';
21207
+ }, $unregister$100.$$arity = -1), nil) && 'unregister';
21043
21208
  })(Opal.get_singleton_class(self), $nesting);
21044
21209
  })($nesting[0], $nesting)
21045
21210
  })($nesting[0], $nesting);
@@ -21395,7 +21560,8 @@ Opal.modules["asciidoctor/js/postscript"] = function(Opal) {
21395
21560
  self.$require("asciidoctor/converter/html5");
21396
21561
  self.$require("asciidoctor/extensions");
21397
21562
  self.$require("asciidoctor/js/asciidoctor_ext");
21398
- return self.$require("asciidoctor/js/opal_ext/logger");
21563
+ self.$require("asciidoctor/js/opal_ext/logger");
21564
+ return Opal.const_set($$($nesting, 'Asciidoctor'), 'InlineLinkRx', new RegExp("" + "(^|link:|" + ($$$($$($nesting, 'Asciidoctor'), 'CG_BLANK')) + "|\\\\?&lt;(?=\\\\?(?:https?|file|ftp|irc)(:))|[>\\(\\)\\[\\];\"'])(\\\\?(?:https?|file|ftp|irc)://)(?:([^\\s\\[\\]]+)\\[(|" + ($$$($$($nesting, 'Asciidoctor'), 'CC_ALL')) + "*?[^\\\\])\\]|(?!\\2)([^\\s]*?)&gt;|([^\\s\\[\\]<]*([^\\s,.?!\\[\\]<\\)])))"));
21399
21565
  };
21400
21566
 
21401
21567
  /* Generated by Opal 0.11.99.dev */
@@ -21530,13 +21696,13 @@ Opal.modules["asciidoctor/js/postscript"] = function(Opal) {
21530
21696
  Opal.const_set($nesting[0], 'FILE_READ_MODE', (function() {if ($truthy($$($nesting, 'RUBY_ENGINE_OPAL'))) {
21531
21697
  return "r"
21532
21698
  } else {
21533
- return "rb:utf-8:utf-8"
21699
+ return "rb:UTF-8:UTF-8"
21534
21700
  }; return nil; })());
21535
21701
  Opal.const_set($nesting[0], 'URI_READ_MODE', $$($nesting, 'FILE_READ_MODE'));
21536
21702
  Opal.const_set($nesting[0], 'FILE_WRITE_MODE', (function() {if ($truthy($$($nesting, 'RUBY_ENGINE_OPAL'))) {
21537
21703
  return "w"
21538
21704
  } else {
21539
- return "w:utf-8"
21705
+ return "wb:UTF-8"
21540
21706
  }; return nil; })());
21541
21707
  Opal.const_set($nesting[0], 'DEFAULT_DOCTYPE', "article");
21542
21708
  Opal.const_set($nesting[0], 'DEFAULT_BACKEND', "html5");
@@ -27022,7 +27188,7 @@ Html5Converter.prototype.convert = function (node, transform, opts) {
27022
27188
  }
27023
27189
 
27024
27190
 
27025
- var ASCIIDOCTOR_JS_VERSION = '2.2.6';
27191
+ var ASCIIDOCTOR_JS_VERSION = '2.2.8';
27026
27192
 
27027
27193
  /**
27028
27194
  * Get Asciidoctor.js version number.