diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2022-09-23 03:03:07 -0600 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2022-09-23 03:03:07 -0600 |
| commit | ca420a93d9595d3f6bb6e669eacdf32d2d2dc0ea (patch) | |
| tree | 293b0b5af94bebc5d52ab8592a3157d040b881b7 | |
| parent | bf2b9597229ac079fd2122aee4ae841e67db35ec (diff) | |
use correct start of string matcher for URI detection when Ruby engine is Opal
| -rw-r--r-- | lib/asciidoctor/rx.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/asciidoctor/rx.rb b/lib/asciidoctor/rx.rb index c212a871..a824335e 100644 --- a/lib/asciidoctor/rx.rb +++ b/lib/asciidoctor/rx.rb @@ -717,7 +717,11 @@ module Asciidoctor # # not c:/sample.adoc or c:\sample.adoc # - UriSniffRx = %r(\A#{CG_ALPHA}[#{CC_ALNUM}.+-]+:/{0,2}) + if RUBY_ENGINE == 'opal' + UriSniffRx = %r(^#{CG_ALPHA}[#{CC_ALNUM}.+-]+:/{0,2}) + else + UriSniffRx = %r(\A#{CG_ALPHA}[#{CC_ALNUM}.+-]+:/{0,2}) + end # Detects XML tags XmlSanitizeRx = /<[^>]+>/ |
