summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2018-11-29 01:34:07 +0100
committerJakub Jirutka <jakub@jirutka.cz>2018-11-29 01:34:07 +0100
commit05aa64b9bbd0081506eeb198f77e9ff4b8096394 (patch)
tree1e6215cbc57a232fdb8174800239a579e5df1862
parent2036a423760a0c9f1efc944d0d200df8dc1ebdab (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--Rakefile2
1 files changed, 1 insertions, 1 deletions
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