diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2018-11-29 01:34:07 +0100 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2018-11-29 01:34:07 +0100 |
commit | 05aa64b9bbd0081506eeb198f77e9ff4b8096394 (patch) | |
tree | 1e6215cbc57a232fdb8174800239a579e5df1862 | |
parent | 2036a423760a0c9f1efc944d0d200df8dc1ebdab (diff) |
JS: Fix Opal build to not mess with backslashes
The problem is that the replacement in `String#sub(pattern, replacement)`
is interpreted by Ruby:
If replacement is a String that looks like a pattern's capture group
but is actually not a pattern capture group e.g. "\'", then it will
have to be preceded by two backslashes like so "\\'".
-rw-r--r-- | Rakefile | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -39,7 +39,7 @@ namespace :build do mkdir_p(File.dirname(out_file), verbose: false) File.open(out_file, 'w') do |file| template = File.read('src/asciidoctor-interdoc-reftext.tmpl.js') - file << template.sub('//OPAL-GENERATED-CODE//', builder.to_s) + file << template.sub('//OPAL-GENERATED-CODE//') { builder.to_s } end File.binwrite "#{out_file}.map", builder.source_map end |