Skip to content

Commit

Permalink
//graph should not be escaped, too
Browse files Browse the repository at this point in the history
  • Loading branch information
takahashim committed Aug 17, 2019
1 parent b6a1ce0 commit 9a9d499
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
17 changes: 9 additions & 8 deletions lib/review/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,12 @@ def inline_w(s)
end

def inline_wb(s)
inline_b(unescape(inline_w(s)))
translated = @dictionary[s]
if translated
inline_b(translated)
else
inline_b("[missing word: #{s}]")
end
end

def raw(str)
Expand Down Expand Up @@ -504,13 +509,13 @@ def graph(lines, id, command, caption = '')
file = "#{id}.#{image_ext}"
file_path = File.join(dir, file)

line = self.unescape(lines.join("\n"))
content = lines.join("\n") + "\n"

tf = Tempfile.new('review_graph')
tf.puts line
tf.puts content
tf.close
begin
file_path = send("graph_#{command}".to_sym, id, file_path, line, tf.path)
file_path = send("graph_#{command}".to_sym, id, file_path, content, tf.path)
ensure
tf.unlink
end
Expand Down Expand Up @@ -634,9 +639,5 @@ def detab(str, num = nil)
def escape(str)
str
end

def unescape(str)
str
end
end
end # module ReVIEW
2 changes: 1 addition & 1 deletion lib/review/compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ def compile_paragraph(f)
def read_command(f)
line = f.gets
name = line.slice(/[a-z]+/).to_sym
ignore_inline = (name == :embed) || (name == :texequation)
ignore_inline = %i[embed texequation graph].include?(name)
args = parse_args(line.sub(%r{\A//[a-z]+}, '').rstrip.chomp('{'), name)
@strategy.doc_status[name] = true
lines = block_open?(line) ? read_block(f, ignore_inline) : nil
Expand Down

0 comments on commit 9a9d499

Please sign in to comment.