|
1 | 1 | # Block quotes
|
2 | 2 | import logging
|
3 |
| -from typing import Optional |
4 | 3 |
|
5 | 4 | from .state_block import StateBlock
|
6 | 5 | from ..common.utils import isSpace
|
@@ -35,21 +34,16 @@ def blockquote(state: StateBlock, startLine: int, endLine: int, silent: bool):
|
35 | 34 | # set offset past spaces and ">"
|
36 | 35 | initial = offset = state.sCount[startLine] + 1
|
37 | 36 |
|
38 |
| - try: |
39 |
| - second_char_code: Optional[int] = state.srcCharCodeAt(pos) |
40 |
| - except IndexError: |
41 |
| - second_char_code = None |
42 |
| - |
43 | 37 | # skip one optional space after '>'
|
44 |
| - if second_char_code == 0x20: # /* space */ |
| 38 | + if state.srcCharCodeAt(pos) == 0x20: # /* space */ |
45 | 39 | # ' > test '
|
46 | 40 | # ^ -- position start of line here:
|
47 | 41 | pos += 1
|
48 | 42 | initial += 1
|
49 | 43 | offset += 1
|
50 | 44 | adjustTab = False
|
51 | 45 | spaceAfterMarker = True
|
52 |
| - elif second_char_code == 0x09: # /* tab */ |
| 46 | + elif state.srcCharCodeAt(pos) == 0x09: # /* tab */ |
53 | 47 | spaceAfterMarker = True
|
54 | 48 |
|
55 | 49 | if (state.bsCount[startLine] + offset) % 4 == 3:
|
@@ -154,21 +148,16 @@ def blockquote(state: StateBlock, startLine: int, endLine: int, silent: bool):
|
154 | 148 | # set offset past spaces and ">"
|
155 | 149 | initial = offset = state.sCount[nextLine] + 1
|
156 | 150 |
|
157 |
| - try: |
158 |
| - next_char: Optional[int] = state.srcCharCodeAt(pos) |
159 |
| - except IndexError: |
160 |
| - next_char = None |
161 |
| - |
162 | 151 | # skip one optional space after '>'
|
163 |
| - if next_char == 0x20: # /* space */ |
| 152 | + if state.srcCharCodeAt(pos) == 0x20: # /* space */ |
164 | 153 | # ' > test '
|
165 | 154 | # ^ -- position start of line here:
|
166 | 155 | pos += 1
|
167 | 156 | initial += 1
|
168 | 157 | offset += 1
|
169 | 158 | adjustTab = False
|
170 | 159 | spaceAfterMarker = True
|
171 |
| - elif next_char == 0x09: # /* tab */ |
| 160 | + elif state.srcCharCodeAt(pos) == 0x09: # /* tab */ |
172 | 161 | spaceAfterMarker = True
|
173 | 162 |
|
174 | 163 | if (state.bsCount[nextLine] + offset) % 4 == 3:
|
|
0 commit comments