aboutsummaryrefslogtreecommitdiffhomepage
path: root/parser/pageparser/pagelexer_intro.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2024-02-07 10:30:32 +0100
committerBjørn Erik Pedersen <[email protected]>2024-02-07 21:37:04 +0100
commit676e6875dac391f1ec1f7369ed2d59439f434806 (patch)
treeaf689eec1f48d511169f8b07f4c65420c7479413 /parser/pageparser/pagelexer_intro.go
parent068ccde4c75d018b977f4169308b3c994c6f3031 (diff)
downloadhugo-676e6875dac391f1ec1f7369ed2d59439f434806.tar.gz
hugo-676e6875dac391f1ec1f7369ed2d59439f434806.zip
Make HTML behave exactly like other content formats (note)
Fixes #11999
Diffstat (limited to 'parser/pageparser/pagelexer_intro.go')
-rw-r--r--parser/pageparser/pagelexer_intro.go30
1 files changed, 0 insertions, 30 deletions
diff --git a/parser/pageparser/pagelexer_intro.go b/parser/pageparser/pagelexer_intro.go
index 25af4170b..0ff0958fe 100644
--- a/parser/pageparser/pagelexer_intro.go
+++ b/parser/pageparser/pagelexer_intro.go
@@ -13,10 +13,6 @@
package pageparser
-import "errors"
-
-var ErrPlainHTMLDocumentsNotSupported = errors.New("plain HTML documents not supported")
-
func lexIntroSection(l *pageLexer) stateFunc {
l.summaryDivider = summaryDivider
@@ -39,19 +35,6 @@ LOOP:
case r == byteOrderMark:
l.emit(TypeIgnore)
case !isSpace(r) && !isEndOfLine(r):
- if r == '<' {
- l.backup()
- if l.hasPrefix(htmlCommentStart) {
- // This may be commented out front matter, which should
- // still be read.
- l.consumeToNextLine()
- l.isInHTMLComment = true
- l.emit(TypeIgnore)
- continue LOOP
- } else {
- return l.documentError(ErrPlainHTMLDocumentsNotSupported)
- }
- }
break LOOP
}
}
@@ -60,19 +43,6 @@ LOOP:
return lexMainSection
}
-func lexEndFrontMatterHTMLComment(l *pageLexer) stateFunc {
- l.isInHTMLComment = false
- right := l.index(htmlCommentEnd)
- if right == -1 {
- return l.errorf("starting HTML comment with no end")
- }
- l.pos += right + len(htmlCommentEnd)
- l.emit(TypeIgnore)
-
- // Now move on to the shortcodes.
- return lexMainSection
-}
-
func lexFrontMatterJSON(l *pageLexer) stateFunc {
// Include the left delimiter
l.backup()