@@ -262,7 +262,9 @@ mod sys {
262
262
// For external sources, we check for common formatting styles for spans
263
263
// and convert them to appropriate formatting nodes.
264
264
let mut formatting_tag = None ;
265
- if child. contains_style ( "font-weight" , "bold" ) {
265
+ if child. contains_style ( "font-weight" , "bold" )
266
+ || child. contains_style ( "font-weight" , "700" )
267
+ {
266
268
formatting_tag = Some ( "b" ) ;
267
269
} else if child. contains_style ( "font-style" , "italic" ) {
268
270
formatting_tag = Some ( "i" ) ;
@@ -1174,6 +1176,7 @@ mod sys {
1174
1176
)
1175
1177
. unwrap ( ) ;
1176
1178
let tree = dom. to_tree ( ) . to_string ( ) ;
1179
+ println ! ( "{}" , tree) ;
1177
1180
assert_eq ! (
1178
1181
tree,
1179
1182
indoc! {
@@ -1186,7 +1189,8 @@ mod sys {
1186
1189
│ └>"Italic"
1187
1190
├>li
1188
1191
│ └>p
1189
- │ └>"Bold"
1192
+ │ └>b
1193
+ │ └>"Bold"
1190
1194
├>li
1191
1195
│ └>p
1192
1196
│ └>"Unformatted"
@@ -1214,7 +1218,7 @@ mod sys {
1214
1218
dom. to_markdown( ) . unwrap( ) . to_string( ) ,
1215
1219
indoc! { r#"
1216
1220
1. *Italic*
1217
- 2. Bold
1221
+ 2. __Bold__
1218
1222
3. Unformatted
1219
1223
4. ~~Strikethrough~~
1220
1224
5. <u>Underlined</u>
@@ -1915,6 +1919,12 @@ mod js {
1915
1919
. get_property_value ( "font-weight" )
1916
1920
. unwrap_or_default ( )
1917
1921
== "bold"
1922
+ || style
1923
+ . get_property_value (
1924
+ "font-weight" ,
1925
+ )
1926
+ . unwrap_or_default ( )
1927
+ == "700"
1918
1928
{
1919
1929
Some ( InlineFormatType :: Bold )
1920
1930
} else if style
@@ -2123,12 +2133,12 @@ mod js {
2123
2133
HtmlSource :: GoogleDoc ,
2124
2134
)
2125
2135
. unwrap ( ) ;
2126
- assert_eq ! ( dom. to_string( ) , "<ol><li><p><em>Italic</em></p></li><li><p>Bold</p></li><li><p>Unformatted</p></li><li><p><del>Strikethrough</del></p></li><li><p><u>Underlined</u></p></li><li><p><a style=\" text-decoration:none;\" href=\" http://matrix.org\" ><u>Linked</u></a></p><ul><li><p>Nested</p></li></ul></li></ol>" ) ;
2136
+ assert_eq ! ( dom. to_string( ) , "<ol><li><p><em>Italic</em></p></li><li><p><strong> Bold</strong> </p></li><li><p>Unformatted</p></li><li><p><del>Strikethrough</del></p></li><li><p><u>Underlined</u></p></li><li><p><a style=\" text-decoration:none;\" href=\" http://matrix.org\" ><u>Linked</u></a></p><ul><li><p>Nested</p></li></ul></li></ol>" ) ;
2127
2137
assert_eq ! (
2128
2138
dom. to_markdown( ) . unwrap( ) . to_string( ) ,
2129
2139
indoc! { r#"
2130
2140
1. *Italic*
2131
- 2. Bold
2141
+ 2. __Bold__
2132
2142
3. Unformatted
2133
2143
4. ~~Strikethrough~~
2134
2144
5. <u>Underlined</u>
0 commit comments