Browse Source

Escape headers too

master
Julien Blanchard 4 months ago
parent
commit
9db62dbad5
1 changed files with 6 additions and 6 deletions
  1. 6
    6
      src/draw.rs

+ 6
- 6
src/draw.rs View File

@@ -35,7 +35,7 @@ pub fn gemini_content(
35 35
             Ok(crate::gemini::parser::TextElement::H1(header)) => {
36 36
                 let mut end_iter = buffer.get_end_iter();
37 37
                 if mono_toggle {
38
-                    buffer.insert_markup(&mut end_iter, &mono_span(header));
38
+                    buffer.insert_markup(&mut end_iter, &mono_span(escape_text(&header)));
39 39
                 } else {
40 40
                   buffer.insert_markup(
41 41
                       &mut end_iter,
@@ -46,7 +46,7 @@ pub fn gemini_content(
46 46
                           crate::settings::get_gemini_h1_font_family(),
47 47
                           crate::settings::get_gemini_h1_font_style(),
48 48
                           crate::settings::get_h1_character(),
49
-                          header
49
+                          escape_text(&header)
50 50
                       ),
51 51
                   );
52 52
                 }
@@ -54,7 +54,7 @@ pub fn gemini_content(
54 54
             Ok(crate::gemini::parser::TextElement::H2(header)) => {
55 55
                 let mut end_iter = buffer.get_end_iter();
56 56
                 if mono_toggle {
57
-                    buffer.insert_markup(&mut end_iter, &mono_span(header));
57
+                    buffer.insert_markup(&mut end_iter, &mono_span(escape_text(&header)));
58 58
                } else {
59 59
                   buffer.insert_markup(
60 60
                       &mut end_iter,
@@ -65,7 +65,7 @@ pub fn gemini_content(
65 65
                           crate::settings::get_gemini_h2_font_family(),
66 66
                           crate::settings::get_gemini_h2_font_style(),
67 67
                           crate::settings::get_h2_character(),
68
-                          header
68
+                          escape_text(&header)
69 69
                       ),
70 70
                   );
71 71
                 }
@@ -73,7 +73,7 @@ pub fn gemini_content(
73 73
             Ok(crate::gemini::parser::TextElement::H3(header)) => {
74 74
                 let mut end_iter = buffer.get_end_iter();
75 75
                 if mono_toggle {
76
-                    buffer.insert_markup(&mut end_iter, &mono_span(header));
76
+                    buffer.insert_markup(&mut end_iter, &mono_span(escape_text(&header)));
77 77
                 } else {
78 78
                     buffer.insert_markup(
79 79
                         &mut end_iter,
@@ -84,7 +84,7 @@ pub fn gemini_content(
84 84
                             crate::settings::get_gemini_h3_font_family(),
85 85
                             crate::settings::get_gemini_h3_font_style(),
86 86
                             crate::settings::get_h3_character(),
87
-                            header
87
+                            escape_text(&header)
88 88
                         ),
89 89
                     );
90 90
                 }

Loading…
Cancel
Save