@@ -1984,7 +1984,7 @@ def _do_code_blocks(self, text: str) -> str:
19841984 (?<!`)
19851985 \1 # Matching closer
19861986 (?!`)
1987- ''' , re .X | re . S )
1987+ ''' , re .X )
19881988
19891989 def _code_span_sub (self , match : re .Match [str ]) -> str :
19901990 c = match .group (2 ).strip (" \t " )
@@ -3262,8 +3262,8 @@ def run(self, text: str):
32623262 )
32633263 if title :
32643264 if self .md .safe_mode :
3265- # expose code span contents for escaping - fix #691
3266- title = self .md ._unhash_html_spans (title , spans = False , code = True )
3265+ # expose span contents for escaping - fix #691, #703
3266+ title = self .md ._unhash_html_spans (title , spans = True , code = True )
32673267 title = (
32683268 _xml_escape_attr (title )
32693269 .replace ('*' , self .md ._escape_table ['*' ])
@@ -3282,8 +3282,8 @@ def run(self, text: str):
32823282 continue
32833283
32843284 if link_text and self .md .safe_mode :
3285- # expose code span contents for escaping - fix #699
3286- link_text = self .md ._unhash_html_spans (link_text , spans = False , code = True )
3285+ # expose span contents for escaping - fix #699, #703
3286+ link_text = self .md ._unhash_html_spans (link_text , spans = True , code = True )
32873287
32883288 start_idx -= 1
32893289 result , skip = self .process_image (url , title_str , link_text )
0 commit comments