An HTML comment inside a <template> tag is treated as a TemplateString, not a Comment
Bug #1913406 reported by
kosmos342
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Beautiful Soup |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
BeautifulSoup breaks html comments inside "template" tag
>>> from bs4 import BeautifulSoup
>>> print(Beautiful
actual result:
<template>
expected result:
<template>
Python: 3.6.12 (installed via pyenv)
OS: macOS 11.1
BeautifulSoup: 4.9.3
To post a comment you must log in.
This is fixed in revision 599. The underlying cause is that most strings inside a <template> tag are supposed to be instantiated with the TemplateString container class. This was interfering with the Comment container class that's used for HTML comments.