Skip to content

Commit

Permalink
Fix beginning of line whitespaces causing asciidoc to think stem bloc…
Browse files Browse the repository at this point in the history
…ks as literals
  • Loading branch information
ronaldtse committed Apr 14, 2020
1 parent 4d9074a commit 04f2a20
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/iev/termbase/term_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def definition_values
end

def replace_newlines(input)
input.gsub('\n', "\n\n").gsub(/<[pbr]+>/, "\n\n").gsub(/\n+/, "\n\n").strip
input.gsub('\n', "\n\n").gsub(/<[pbr]+>/, "\n\n").gsub(/\s*\n[\n\s]+/, "\n\n").strip
end

def split_definition
Expand Down Expand Up @@ -287,7 +287,10 @@ def parse_anchor_tag(text)
gsub(/<a href=(IEV)\s*(.*?)>(.*?)<\/a>/, '{{\3, \1:\2}}').
gsub(/<a href="(.*?)">(.*?)<\/a>/, '\1[\2]').
gsub(/<simg .*\/\$file\/([\d\-\w\.]+)>\s*Figure\s+(\d)\s+[–-]\s+(.+?)\s*<\/b>\s+Figure\s+(\d)\s+[–-]\s(.+)\s*<\/b>/, "image::/assets/images/parts/#{part_number}/\\1[Figure \\2 - \\3; \\5]").
gsub(/<simg .*\/\$file\/([\d\-\w\.]+)>\s*Figure\s+(\d)\s+[–-]\s+(.+?)\s*<\/b>/, "image::/assets/images/parts/#{part_number}/\\1[Figure \\2 - \\3]")
gsub(/<simg .*\/\$file\/([\d\-\w\.]+)>\s*Figure\s+(\d)\s+[–-]\s+(.+?)\s*<\/b>/, "image::/assets/images/parts/#{part_number}/\\1[Figure \\2 - \\3]").
gsub(/<\/?ul>/, '').
gsub(/<li>/, '* ').
gsub(/<\/li>/, '')
end
end
end
Expand Down

0 comments on commit 04f2a20

Please sign in to comment.