Skip to content

Commit

Permalink
fix: ensure we capture all the documentation tags
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound committed Jul 25, 2019
1 parent e9f7c10 commit 6fcb117
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/block-parsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const _headingToMethodBlock = (
): MethodDocumentationBlock | null => {
if (!heading) return null;

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

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

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

0 comments on commit 6fcb117

Please sign in to comment.