(
text: str, markups: list, is_code: bool = False
)
| 226 | current_pos = 0 |
| 227 | |
| 228 | def parse_paragraph_text( |
| 229 | text: str, markups: list, is_code: bool = False |
| 230 | ) -> RLStringHelper: |
| 231 | # Hotfix, workaround for code block |
| 232 | has_code_block = any(markup["type"] == "CODE" for markup in markups) |
| 233 | if is_code or has_code_block: |
| 234 | quote_html_type = ["minimal"] |
| 235 | # quote_html_type = None |
| 236 | else: |
| 237 | quote_html_type = ["full"] |
| 238 | text_formater = RLStringHelper(text, quote_html_type=quote_html_type) |
| 239 | |
| 240 | parsed_markups = parse_markups(markups) |
| 241 | fixed_markups = split_overlapping_ranges(parsed_markups) |
| 242 | |
| 243 | for markup in fixed_markups: |
| 244 | text_formater.set_template( |
| 245 | markup["start"], markup["end"], markup["template"] |
| 246 | ) |
| 247 | |
| 248 | return text_formater |
| 249 | |
| 250 | while len(paragraphs) > current_pos: |
| 251 | paragraph = paragraphs[current_pos] |
nothing calls this directly
no test coverage detected