-
Notifications
You must be signed in to change notification settings - Fork 32
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
Change applyElement
to call HTMLProcessor
#60
Conversation
This patch changes `Parser.applyElement` to call the `HTMLProcessor` class. The `HTMLProcessorOptions.separator` is changed to accept a `Node`. This is because `undefined` had double meanings; i.e., use the default (ZWSP) and use the `<wbr>` element.
@tushuhei Please feel free to request changes or reject if this is not desirable as we discussed. This patch tries not to change the arguments and the separator of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR! I just put some nit comments.
javascript/src/parser.ts
Outdated
} | ||
}; | ||
processChildren(parentElement); | ||
const html_processor = new HTMLProcessor(this, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit. Let's rename this to htmlProcessor
just for naming consistency :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, sorry I was using wrong styleguide ;-P
javascript/README.md
Outdated
|
||
```javascript | ||
import { HTMLProcessor } from 'budoux'; | ||
const ele = document.querySelector('p.budou-this'); | ||
const applier = new HTMLProcessor(parser); | ||
applier.applyToElement(ele); | ||
const html_processor = new HTMLProcessor(parser, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Thanks for the fix! |
This patch changes
Parser.applyElement
to call theHTMLProcessor
class.The
HTMLProcessorOptions.separator
is changed to accept aNode
. This is becauseundefined
had double meanings; i.e., use the default (ZWSP) and use the<wbr>
element.