File: pulldown-cmark-0.13.patch

package info (click to toggle)
mdbook 0.4.52%2Bds-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,380 kB
  • sloc: javascript: 1,140; sh: 75; python: 28; makefile: 26
file content (43 lines) | stat: -rw-r--r-- 2,079 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
This patch is based on the upstream commit described below, adapted for use
in the upstream package by Peter Michael Green.

commit 91f04bc7bae2fb56ae11e3086553c4fdb0b68da0
Author: Roms1383 <romain.kelifa@gmail.com>
Date:   Sun Jun 16 10:16:10 2024 +0700

    Upgrade pulldown-cmark to 0.13.0

diff --git a/Cargo.toml b/Cargo.toml
index f027a20a..69af69a8 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -51,1 +51,1 @@
-pulldown-cmark = { version = "0.10.0", default-features = false, features = ["html"] } # Do not update, part of the public api.
+pulldown-cmark = { version = "0.13.0", default-features = false, features = ["html"] } # Do not update, part of the public api.
diff --git a/examples/remove-emphasis/mdbook-remove-emphasis/Cargo.toml b/examples/remove-emphasis/mdbook-remove-emphasis/Cargo.toml
index 1b55e291..8b2edd03 100644
--- a/examples/remove-emphasis/mdbook-remove-emphasis/Cargo.toml
+++ b/examples/remove-emphasis/mdbook-remove-emphasis/Cargo.toml
@@ -5,2 +5,2 @@
-pulldown-cmark = { version = "0.12.2", default-features = false }
-pulldown-cmark-to-cmark = "18.0.0"
+pulldown-cmark = { workspace = true, default-features = false }
+pulldown-cmark-to-cmark = "21.0.0"
diff --git a/src/renderer/html_handlebars/search.rs b/src/renderer/html_handlebars/search.rs
index 0c067905..b14c9c67 100644
--- a/src/renderer/html_handlebars/search.rs
+++ b/src/renderer/html_handlebars/search.rs
@@ -200,6 +200,13 @@ fn render_item(
                 // blocks, and worse case you have some noise in the index.
                 body.push_str(&clean_html(&html));
             }
+            Event::InlineMath(text) | Event::DisplayMath(text) => {
+                if in_heading {
+                    heading.push_str(&text);
+                } else {
+                    body.push_str(&text);
+                }
+            }
             Event::Start(_) | Event::End(_) | Event::Rule | Event::SoftBreak | Event::HardBreak => {
                 // Insert spaces where HTML output would usually separate text
                 // to ensure words don't get merged together