Commit ff77a3c
Fix
Update `LIST_ITEM_START_PATTERN` from `(?:\s*)((-|\*|[0-9]+\.)\s)` to `(?:\s*)(([-+*]|[0-9]+[.)])\s)`. This allows `TokenVisitor.visitListItem` to correctly recognize ordered list markers that use a right parenthesis (`)`) as permitted by Section 5.2 of the CommonMark spec (e.g., `1) foo`), as well as bullet lists using plus (`+ foo`).
PiperOrigin-RevId: 943602624VerifyException in MarkdownPositions when formatting ordered list items with right parenthesis or plus bullet markers.1 parent 3bfe3d9 commit ff77a3c
3 files changed
Lines changed: 57 additions & 13 deletions
File tree
- core/src
- main/java/com/google/googlejavaformat/java/javadoc
- test/java/com/google/googlejavaformat/java
- javadoc
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | | - | |
| 261 | + | |
262 | 262 | | |
Lines changed: 17 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | | - | |
24 | 22 | | |
25 | 23 | | |
26 | 24 | | |
| |||
2124 | 2122 | | |
2125 | 2123 | | |
2126 | 2124 | | |
2127 | | - | |
2128 | | - | |
2129 | | - | |
2130 | 2125 | | |
2131 | 2126 | | |
2132 | 2127 | | |
2133 | 2128 | | |
2134 | 2129 | | |
| 2130 | + | |
2135 | 2131 | | |
2136 | 2132 | | |
2137 | 2133 | | |
2138 | 2134 | | |
2139 | | - | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
| 2150 | + | |
2140 | 2151 | | |
2141 | 2152 | | |
2142 | 2153 | | |
| |||
Lines changed: 39 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | | - | |
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
| |||
67 | 65 | | |
68 | 66 | | |
69 | 67 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | 68 | | |
74 | 69 | | |
75 | 70 | | |
76 | 71 | | |
77 | 72 | | |
78 | 73 | | |
79 | 74 | | |
80 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
81 | 114 | | |
82 | 115 | | |
83 | 116 | | |
| |||
0 commit comments