(state: StateBlock, nextLine: int)
| 193 | |
| 194 | |
| 195 | def getNextLine(state: StateBlock, nextLine: int) -> None | str: |
| 196 | endLine = state.lineMax |
| 197 | |
| 198 | if nextLine >= endLine or state.isEmpty(nextLine): |
| 199 | # empty line or end of input |
| 200 | return None |
| 201 | |
| 202 | isContinuation = False |
| 203 | |
| 204 | # this would be a code block normally, but after paragraph |
| 205 | # it's considered a lazy continuation regardless of what's there |
| 206 | if state.is_code_block(nextLine): |
| 207 | isContinuation = True |
| 208 | |
| 209 | # quirk for blockquotes, this line should already be checked by that rule |
| 210 | if state.sCount[nextLine] < 0: |
| 211 | isContinuation = True |
| 212 | |
| 213 | if not isContinuation: |
| 214 | terminatorRules = state.md.block.ruler.getRules("reference") |
| 215 | oldParentType = state.parentType |
| 216 | state.parentType = "reference" |
| 217 | |
| 218 | # Some tags can terminate paragraph without empty line. |
| 219 | terminate = False |
| 220 | for terminatorRule in terminatorRules: |
| 221 | if terminatorRule(state, nextLine, endLine, True): |
| 222 | terminate = True |
| 223 | break |
| 224 | |
| 225 | state.parentType = oldParentType |
| 226 | |
| 227 | if terminate: |
| 228 | # terminated by another block |
| 229 | return None |
| 230 | |
| 231 | pos = state.bMarks[nextLine] + state.tShift[nextLine] |
| 232 | maximum = state.eMarks[nextLine] |
| 233 | |
| 234 | # max + 1 explicitly includes the newline |
| 235 | return state.src[pos : maximum + 1] |
no test coverage detected
searching dependent graphs…