From 88762a4e47c8b2ef6c7746148acad9a116436425 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Sat, 22 Feb 2014 00:50:35 +0000 Subject: [PATCH] [GB.MARKDOWN] * BUG: Fix markup mismatch detection again. git-svn-id: svn://localhost/gambas/trunk@6173 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- comp/src/gb.markdown/.src/Markup.module | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/comp/src/gb.markdown/.src/Markup.module b/comp/src/gb.markdown/.src/Markup.module index 5f552a808..8e7f08123 100644 --- a/comp/src/gb.markdown/.src/Markup.module +++ b/comp/src/gb.markdown/.src/Markup.module @@ -673,11 +673,21 @@ ENTER_MARKUP: If Left$(sPattern) = "/" Then sPattern = Mid$(sPattern, 2) If Not ["img", "hr", "br"].Exist(sPattern) Then - If $aMarkup.Count = 0 Then - Error.Raise("Mismatched markup: ") - Else If LCase($aMarkup[$aMarkup.Max]) <> LCase(sPattern) Then - Error.Raise("Mismatched markup: against <" & $aMarkup[$aMarkup.Max] & ">") - Endif + + Do + If $aMarkup.Count = 0 Then Error.Raise("Mismatched markup: ") + + If LCase($aMarkup[$aMarkup.Max]) <> LCase(sPattern) Then + If LCase($aMarkup[$aMarkup.Max]) = "

" Then + sResult &= "

" + $aMarkup.Remove($aMarkup.Max) + Continue + Endif + Error.Raise("Mismatched markup: against <" & $aMarkup[$aMarkup.Max] & ">") + Endif + + Loop + sResult &= "" $aMarkup.Remove($aMarkup.Max) Endif