mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
[search] filter script and style elements from search result summary text. (#12057)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
This commit is contained in:
@@ -61,20 +61,33 @@ describe('Basic html theme search', function() {
|
||||
describe("htmlToText", function() {
|
||||
|
||||
const testHTML = `<html>
|
||||
<div class="body" role="main">
|
||||
<section id="getting-started">
|
||||
<h1>Getting Started</h1>
|
||||
<p>Some text</p>
|
||||
</section>
|
||||
<section id="other-section">
|
||||
<h1>Other Section</h1>
|
||||
<p>Other text</p>
|
||||
</section>
|
||||
<section id="yet-another-section">
|
||||
<h1>Yet Another Section</h1>
|
||||
<p>More text</p>
|
||||
</section>
|
||||
</div>
|
||||
<body>
|
||||
<script src="directory/filename.js"></script>
|
||||
<div class="body" role="main">
|
||||
<script>
|
||||
console.log('dynamic');
|
||||
</script>
|
||||
<style>
|
||||
div.body p.centered {
|
||||
text-align: center;
|
||||
margin-top: 25px;
|
||||
}
|
||||
</style>
|
||||
<!-- main content -->
|
||||
<section id="getting-started">
|
||||
<h1>Getting Started</h1>
|
||||
<p>Some text</p>
|
||||
</section>
|
||||
<section id="other-section">
|
||||
<h1>Other Section</h1>
|
||||
<p>Other text</p>
|
||||
</section>
|
||||
<section id="yet-another-section">
|
||||
<h1>Yet Another Section</h1>
|
||||
<p>More text</p>
|
||||
</section>
|
||||
</div>
|
||||
</body>
|
||||
</html>`;
|
||||
|
||||
it("basic case", () => {
|
||||
|
||||
Reference in New Issue
Block a user