-
Notifications
You must be signed in to change notification settings - Fork 74
add a visual indicator to AC bodies #684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -284,10 +284,7 @@ export function doesEffectPropagateToParent(node: Element, effect: string) { | |
| // This is super hacky. It's checking the output of ecmarkdown. | ||
| if (parent.tagName !== 'LI') continue; | ||
|
|
||
| if ( | ||
| effect === 'user-code' && | ||
| /be a new (\w+ )*Abstract Closure/.test(parent.textContent ?? '') | ||
| ) { | ||
| if (effect === 'user-code' && isAbstractClosureHeader(ownTextContent(parent))) { | ||
| return false; | ||
| } | ||
|
|
||
|
|
@@ -343,3 +340,17 @@ export function withOrdinalSuffix(n: number): string { | |
| const suffixes = { one: 'st', two: 'nd', few: 'rd', other: 'th' }; | ||
| return `${n}${suffixes[rule as keyof typeof suffixes]}`; | ||
| } | ||
|
|
||
| const acHeaderRe = / performs the following steps (atomically )?when called:$/; | ||
| export function isAbstractClosureHeader(text: string): boolean { | ||
| return acHeaderRe.test(text); | ||
| } | ||
|
|
||
| export function ownTextContent(el: Element): string { | ||
| let text = ''; | ||
| for (const child of el.childNodes) { | ||
| if (child.nodeType === 1 && (child as Element).tagName === 'OL') continue; | ||
| text += child.textContent; | ||
| } | ||
| return text; | ||
| } | ||
|
Comment on lines
+349
to
+356
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the record, I have the same complaint about this function as @bakkot raised about my proposed If we're going to keep this function implementation (given an element, return the concatenation of all non-<ol> children's |
||
Uh oh!
There was an error while loading. Please reload this page.