From fad80b4f0c979692bba0b2a03c6280f1c64a52d9 Mon Sep 17 00:00:00 2001 From: yuin Date: Sat, 11 Sep 2021 09:48:43 +0900 Subject: [PATCH] Fix #245 - 2 --- _test/extra.txt | 6 ++++++ parser/html_block.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/_test/extra.txt b/_test/extra.txt index f194d69..41b1d7d 100644 --- a/_test/extra.txt +++ b/_test/extra.txt @@ -374,3 +374,9 @@ a* b c d *e*

a* b c d e

//= = = = = = = = = = = = = = = = = = = = = = = =// +24: HTML block tags can contain trailing spaces +//- - - - - - - - -// + +//- - - - - - - - -// + +//= = = = = = = = = = = = = = = = = = = = = = = =// diff --git a/parser/html_block.go b/parser/html_block.go index 45c0fa2..db2cf11 100644 --- a/parser/html_block.go +++ b/parser/html_block.go @@ -93,7 +93,7 @@ var htmlBlockType5Close = []byte{']', ']', '>'} var htmlBlockType6Regexp = regexp.MustCompile(`^[ ]{0,3}.*|/>.*|)\n?$`) -var htmlBlockType7Regexp = regexp.MustCompile(`^[ ]{0,3}<(/)?([a-zA-Z0-9\-]+)(` + attributePattern + `*)(:?>|/>)\s*\n?$`) +var htmlBlockType7Regexp = regexp.MustCompile(`^[ ]{0,3}<(/)?\s*([a-zA-Z0-9\-]+)(` + attributePattern + `*)\s*(:?>|/>)\s*\n?$`) type htmlBlockParser struct { }