From 89f5e103c8070211350528b4c1fc6a2348d10315 Mon Sep 17 00:00:00 2001 From: takahashim Date: Sun, 18 Aug 2019 15:16:01 +0900 Subject: [PATCH] use `@non_parsed_commands` --- lib/review/compiler.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/review/compiler.rb b/lib/review/compiler.rb index 7cd425029..62aca44d8 100644 --- a/lib/review/compiler.rb +++ b/lib/review/compiler.rb @@ -16,6 +16,9 @@ module ReVIEW class Compiler def initialize(strategy) @strategy = strategy + + ## commands which do not parse block lines in compiler + @non_parsed_commands = %i[embed texequation graph] end attr_reader :strategy @@ -422,7 +425,7 @@ def compile_paragraph(f) def read_command(f) line = f.gets name = line.slice(/[a-z]+/).to_sym - ignore_inline = %i[embed texequation graph].include?(name) + ignore_inline = @non_parsed_commands.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