Skip to content

Commit

Permalink
only patch to Reader for Asciidoctor < 2.0.16
Browse files Browse the repository at this point in the history
  • Loading branch information
mojavelinux committed Aug 8, 2021
1 parent fd724fb commit c2fe7c6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/asciidoctor-performance-patch.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
'use strict'

// Fixes a performance issue with Asciidoctor.js 2 when used with Node.js 10
if (process.version.startsWith('v10.')) {
const Asciidoctor = global.Opal.Asciidoctor

Asciidoctor.Compliance.underline_style_section_titles = false
const Asciidoctor = global.Opal.Asciidoctor
Asciidoctor.Compliance.underline_style_section_titles = false

// Fixes a performance issue with Asciidoctor.js 2 when used with Node.js 10
if (process.version.startsWith('v10.') && Asciidoctor.VERSION < '2.0.16') {
Asciidoctor.Reader.prototype.$shift = function () {
this.lineno++
if (this.look_ahead) this.look_ahead--
Expand Down

0 comments on commit c2fe7c6

Please sign in to comment.