mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-15 20:44:01 +02:00
Make HTML behave exactly like other content formats (note)
Fixes #11999
This commit is contained in:
@@ -43,8 +43,6 @@ type pageLexer struct {
|
||||
summaryDivider []byte
|
||||
// Set when we have parsed any summary divider
|
||||
summaryDividerChecked bool
|
||||
// Whether we're in a HTML comment.
|
||||
isInHTMLComment bool
|
||||
|
||||
lexerShortcodeState
|
||||
|
||||
@@ -102,8 +100,6 @@ var (
|
||||
delimTOML = []byte("+++")
|
||||
delimYAML = []byte("---")
|
||||
delimOrg = []byte("#+")
|
||||
htmlCommentStart = []byte("<!--")
|
||||
htmlCommentEnd = []byte("-->")
|
||||
)
|
||||
|
||||
func (l *pageLexer) next() rune {
|
||||
@@ -232,13 +228,6 @@ func (l *pageLexer) errorf(format string, args ...any) stateFunc {
|
||||
return nil
|
||||
}
|
||||
|
||||
// documentError can be used to signal a fatal error in the lexing process.
|
||||
// nil terminates the parser
|
||||
func (l *pageLexer) documentError(err error) stateFunc {
|
||||
l.err = err
|
||||
return nil
|
||||
}
|
||||
|
||||
func (l *pageLexer) consumeCRLF() bool {
|
||||
var consumed bool
|
||||
for _, r := range crLf {
|
||||
@@ -251,15 +240,6 @@ func (l *pageLexer) consumeCRLF() bool {
|
||||
return consumed
|
||||
}
|
||||
|
||||
func (l *pageLexer) consumeToNextLine() {
|
||||
for {
|
||||
r := l.next()
|
||||
if r == eof || isEndOfLine(r) {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (l *pageLexer) consumeToSpace() {
|
||||
for {
|
||||
r := l.next()
|
||||
@@ -441,10 +421,6 @@ func lexMainSection(l *pageLexer) stateFunc {
|
||||
return lexDone
|
||||
}
|
||||
|
||||
if l.isInHTMLComment {
|
||||
return lexEndFrontMatterHTMLComment
|
||||
}
|
||||
|
||||
// Fast forward as far as possible.
|
||||
skip := l.sectionHandlers.skip()
|
||||
|
||||
|
Reference in New Issue
Block a user