Commit 3c6e1889 authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Fix for grid table body separator regex when just one column

parent 9d1e8b3b
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ markdownLink = re.compile(r'[^!]\[[^\]]*\]\((#[^)]*)\)', re.IGNORECASE)
matchCodefenceStart = re.compile(r'\s*```\s?.*', re.IGNORECASE)
matchCodefenceEnd = re.compile(r'\s*```\s?', re.IGNORECASE)
matchGridTable = re.compile(r'^\s*\+-.*\+\s$', re.IGNORECASE)
matchGridTableBodySeparator = re.compile(r'^[+|].*(\+[:-]+\+($|.*[+|]$))', re.IGNORECASE)
matchGridTableBodySeparator = re.compile(r'^[+|](.*(\+[:-]+\+($|.*[+|]$))|[-]+[|+]$)', re.IGNORECASE)
matchGridTableBodySeparatorLine = re.compile(r'^:?-+:?$', re.IGNORECASE)
matchGridTableHeaderSeparator = re.compile(r'^\+([=:]+\+)+$', re.IGNORECASE)
matchGridTableSeparator = re.compile(r'^\+([-:=]+\+)+$', re.IGNORECASE)
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ module Banzai
      # Add these regex constants at the top of the file, after the require statement
      GRID_TABLE_SEPARATOR = /^\+([-:=]+\+)+$/
      GRID_TABLE_HEADER_SEPARATOR = /^\+([=:]+\+)+$/
      GRID_TABLE_BODY_SEPARATOR = /^[+|][^\n]*(\+[:-]+\+($|[^\n]*[+|]$))/
      GRID_TABLE_BODY_SEPARATOR = /^[+|]([^\n]*(\+[:-]+\+($|[^\n]*[+|]$))|[-]+[|+]$)/
      GRID_TABLE_BODY_SEPARATOR_LINE = /^:?-+:?$/
      GRID_TABLE_DELIMITER = /(?<!\\)\||(?=\+:?[-=]+:?\+)\+|(?<![^-=:])\+|\|$/