(diff_level=0)
| 182 | return hyper_link_pattern.sub(replace_link, chapter) |
| 183 | |
| 184 | def replace_heading_func(diff_level=0): |
| 185 | |
| 186 | def replace_heading(match): |
| 187 | if diff_level == 0: |
| 188 | return match.group(0) |
| 189 | else: |
| 190 | return '\n' + '#' * (match.group(0).count('#') + diff_level) + ' ' |
| 191 | |
| 192 | |
| 193 | return replace_heading |
| 194 | |
| 195 | # remove <StickyHeaderTable> / </StickyHeaderTable> tags for PDF output |
| 196 | sticky_header_table_pattern = re.compile(r'^\s*</?StickyHeaderTable\s*/?>\s*$') |