Commit 819027cd authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Merge branch 'master' into fixListStyles

parents 1c4a4f6e 1aaf5d2d
Loading
Loading
Loading
Loading
Loading
+3
Changes for generateBaseline/postprocessing.py: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -956,7 +956,10 @@ def update_heading_styles(docx_input, docx_output):
            # Change style from Heading 1 to Heading 8
            pStyle_elems = para.xpath('./w:pPr/w:pStyle[@w:val="Heading1"]', namespaces=ns)
            if pStyle_elems:
                if re.match(r'\(informative|normative|informative or normative|normative or informative\)', annex_letter, re.IGNORECASE):
                    pStyle_elems[0].set(f"{{{ns['w']}}}val", "Heading8")# Heading8 for certain specs. editHelp is going to harmonise that 
                else:
                    pStyle_elems[0].set(f"{{{ns['w']}}}val", "Heading9")# Heading9 for certain specs. editHelp is going to harmonise that 
            insert_page_break_before_heading(para, full_text)  
            counter_annex += 1
        # Annex subheading Heading 2: "A.1 Title", not matching "A.1.1 Title"
+24 −4
Changes for gitlabFilter/grid_table_filter.rb: 24 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -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}"
@@ -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