Loading gitlabFilter/grid_table_filter.rb +24 −4 Changes for gitlabFilter/grid_table_filter.rb: 24 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -146,7 +146,7 @@ module Banzai cell.content = modified_content.gsub(/\\\s*$/, '<br>') end elsif modified_content.lstrip.match?(/^(?:>?\s*(?:[-*+]|\d+\.|\d+\))\s.*)/) # List cell.content += '\n' unless cell.list_flag #cell.content += '\n' unless cell.list_flag cell.list_flag = true modified_content = modified_content.gsub(/\\\s*$/, '<br>') cell.content += "#{modified_content}#{NEXT_ELEMENT_LIST_MARK}" Loading @@ -163,17 +163,37 @@ module Banzai elsif modified_content.empty? || modified_content.end_with?('>') if cell.list_flag cell.list_flag = false cell.content += '\n\n' end cell.content += cell.content.end_with?('\n') ? "" : "\\n#{modified_content}\\n" if modified_content.empty? # True blank line: ends the current markdown block so a following # "> NOTE" starts a separate blockquote. unless cell.content.end_with?('\n\n') cell.content += cell.content.end_with?('\n') ? '\n' : '\n\n' end else # Blockquote-only blank (">" with optional leading spaces): keep a # single blockquote, e.g. # > NOTE 1: ... # > # > NOTE 2: ... cell.content += '\n' + modified_content + '\n' end else if cell.content.end_with?('<br>') starts_blockquote = modified_content.lstrip.start_with?('>') # Only strip '>' when continuing a soft-broken line, not for a new blockquote if cell.content.end_with?('<br>') && !starts_blockquote modified_content = modified_content.gsub(/\s*>\s*/, "") # remove > from the beginning of the line end modified_content = modified_content.gsub(/\\\s*$/, '<br>') if cell.content.end_with?('<br>') # a force linebreak is present cell.content += modified_content elsif cell.content.end_with?('\n') # After a paragraph/`>` break: new line, no leading space cell.content += modified_content elsif starts_blockquote # Continue the same blockquote on the next line (single newline) cell.content += '\n' + modified_content else # Multiline content is concatenated to the last line with a space cell.content += " #{modified_content}" end Loading Loading
gitlabFilter/grid_table_filter.rb +24 −4 Changes for gitlabFilter/grid_table_filter.rb: 24 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -146,7 +146,7 @@ module Banzai cell.content = modified_content.gsub(/\\\s*$/, '<br>') end elsif modified_content.lstrip.match?(/^(?:>?\s*(?:[-*+]|\d+\.|\d+\))\s.*)/) # List cell.content += '\n' unless cell.list_flag #cell.content += '\n' unless cell.list_flag cell.list_flag = true modified_content = modified_content.gsub(/\\\s*$/, '<br>') cell.content += "#{modified_content}#{NEXT_ELEMENT_LIST_MARK}" Loading @@ -163,17 +163,37 @@ module Banzai elsif modified_content.empty? || modified_content.end_with?('>') if cell.list_flag cell.list_flag = false cell.content += '\n\n' end cell.content += cell.content.end_with?('\n') ? "" : "\\n#{modified_content}\\n" if modified_content.empty? # True blank line: ends the current markdown block so a following # "> NOTE" starts a separate blockquote. unless cell.content.end_with?('\n\n') cell.content += cell.content.end_with?('\n') ? '\n' : '\n\n' end else # Blockquote-only blank (">" with optional leading spaces): keep a # single blockquote, e.g. # > NOTE 1: ... # > # > NOTE 2: ... cell.content += '\n' + modified_content + '\n' end else if cell.content.end_with?('<br>') starts_blockquote = modified_content.lstrip.start_with?('>') # Only strip '>' when continuing a soft-broken line, not for a new blockquote if cell.content.end_with?('<br>') && !starts_blockquote modified_content = modified_content.gsub(/\s*>\s*/, "") # remove > from the beginning of the line end modified_content = modified_content.gsub(/\\\s*$/, '<br>') if cell.content.end_with?('<br>') # a force linebreak is present cell.content += modified_content elsif cell.content.end_with?('\n') # After a paragraph/`>` break: new line, no leading space cell.content += modified_content elsif starts_blockquote # Continue the same blockquote on the next line (single newline) cell.content += '\n' + modified_content else # Multiline content is concatenated to the last line with a space cell.content += " #{modified_content}" end Loading