Skip to content

Commit 6fcb117

Browse files
fix: ensure we capture all the documentation tags
1 parent e9f7c10 commit 6fcb117

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/block-parsers.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const _headingToMethodBlock = (
7979
): MethodDocumentationBlock | null => {
8080
if (!heading) return null;
8181

82-
const methodStringRegexp = /`(?:.+\.)?(.+?)(\(.*?\))`( _(?:[^_]+?)_)*/g;
82+
const methodStringRegexp = /`(?:.+\.)?(.+?)(\(.*?\))`((?: _[^_]+?_)*)/g;
8383
const methodStringMatch = methodStringRegexp.exec(heading.heading)!;
8484
methodStringRegexp.lastIndex = -1;
8585
expect(heading.heading).to.match(
@@ -135,7 +135,7 @@ export const _headingToMethodBlock = (
135135
};
136136

137137
export const _headingToPropertyBlock = (heading: HeadingContent): PropertyDocumentationBlock => {
138-
const propertyStringRegexp = /`(?:.+\.)?(.+?)`( _(?:[^_]+?)_)*/g;
138+
const propertyStringRegexp = /`(?:.+\.)?(.+?)`((?: _[^_]+?_)*)/g;
139139
const propertyStringMatch = propertyStringRegexp.exec(heading.heading)!;
140140
propertyStringRegexp.lastIndex = -1;
141141
expect(heading.heading).to.match(
@@ -165,7 +165,7 @@ export const _headingToPropertyBlock = (heading: HeadingContent): PropertyDocume
165165
};
166166

167167
export const _headingToEventBlock = (heading: HeadingContent): EventDocumentationBlock => {
168-
const eventNameRegexp = /^Event: '(.+)'( _(?:[^_]+?)_)*/g;
168+
const eventNameRegexp = /^Event: '(.+)'((?: _[^_]+?_)*)/g;
169169
const eventNameMatch = eventNameRegexp.exec(heading.heading)!;
170170
eventNameRegexp.lastIndex = -1;
171171
expect(heading.heading).to.match(eventNameRegexp, 'each event should have a quoted event name');

0 commit comments

Comments
 (0)