-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,9 +109,13 @@ def process(document) | |
# Second pass: replace citations with citation texts. | ||
prose_blocks.each do |block| | ||
if block.context == :list_item || block.context == :table_cell | ||
line = block.text | ||
line = processor.replace_citation_macros(line) | ||
block.text = line | ||
# NOTE: we access the instance variable @text directly to prevent | ||
# asciidoctor from changing the raw texts. | ||
line = block.instance_variable_get(:@text) | ||
if !line.empty? | ||
line = processor.replace_citation_macros(line) | ||
block.instance_variable_set(:@text, line) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ProgramFan
Author
Contributor
|
||
end | ||
else | ||
block.lines.each_with_index do |line, index| | ||
line = processor.replace_citation_macros(line) | ||
|
You don't need to use instance_variable_set to assign the text. You only need to use the low-level operation to read it. So this line can be changed back to: