We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Dear all,
Problem: There is a list of classes, e.g. class1, class2, class3. We have them rolled up into format my_class like this
import { ClassAttributor, Scope} from 'parchment'; const config = { scope: Scope.BLOCK, whitelist: ['class1', 'class2', 'class3'] }; const AlignClass = new ClassAttributor('align', '', config);
Draw attention, prefix is an empty string.
In this case I expect dom element classes like class1, class2, class3, but they are -class1, -class2 -class3.
Current code does not support empty prefix src/attributor/class.ts
src/attributor/class.ts
function match(node: HTMLElement, prefix: string): string[] { const className = node.getAttribute('class') || ''; return className .split(/\s+/) .filter((name) => name.indexOf(`${prefix}-`) === 0); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Dear all,
Problem:
There is a list of classes, e.g. class1, class2, class3.
We have them rolled up into format my_class like this
Draw attention, prefix is an empty string.
In this case I expect dom element classes like class1, class2, class3, but they are -class1, -class2 -class3.
Current code does not support empty prefix
src/attributor/class.ts
The text was updated successfully, but these errors were encountered: