[GB.MARKDOWN]

* BUG: Fix markup mismatch detection again.


git-svn-id: svn://localhost/gambas/trunk@6173 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2014-02-22 00:50:35 +00:00
parent 83d7271afc
commit 88762a4e47

View file

@ -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: </" & sPattern & ">")
Else If LCase($aMarkup[$aMarkup.Max]) <> LCase(sPattern) Then
Error.Raise("Mismatched markup: </" & sPattern & "> against <" & $aMarkup[$aMarkup.Max] & ">")
Endif
Do
If $aMarkup.Count = 0 Then Error.Raise("Mismatched markup: </" & sPattern & ">")
If LCase($aMarkup[$aMarkup.Max]) <> LCase(sPattern) Then
If LCase($aMarkup[$aMarkup.Max]) = "<p>" Then
sResult &= "</p>"
$aMarkup.Remove($aMarkup.Max)
Continue
Endif
Error.Raise("Mismatched markup: </" & sPattern & "> against <" & $aMarkup[$aMarkup.Max] & ">")
Endif
Loop
sResult &= "</" & sPattern & ">"
$aMarkup.Remove($aMarkup.Max)
Endif