From 05aa64b9bbd0081506eeb198f77e9ff4b8096394 Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Thu, 29 Nov 2018 01:34:07 +0100 Subject: 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 "\\'". --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 438e67c..46dd4bd 100644 --- a/Rakefile +++ b/Rakefile @@ -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 -- cgit v1.2.3