use ParserContext and add more element types in HTMLSchema (default)#42
Open
manish211 wants to merge 1 commit intoyahoo:masterfrom
Open
use ParserContext and add more element types in HTMLSchema (default)#42manish211 wants to merge 1 commit intoyahoo:masterfrom
manish211 wants to merge 1 commit intoyahoo:masterfrom
Conversation
lafa
reviewed
Nov 24, 2019
| r = new Parser(); | ||
| } | ||
| theSchema = new HTMLSchema(true); | ||
| theSchema = new HTMLSchema(new ParserContext(true)); |
Contributor
There was a problem hiding this comment.
get the Context from the parser instance above.
lafa
reviewed
Nov 24, 2019
Comment on lines
+320
to
+328
| /** | ||
| * Set the parser context. | ||
| * @param parserContext the parser context | ||
| */ | ||
| public void setParserContext(final ParserContext parserContext) { | ||
| this.parserContext = parserContext; | ||
| } |
Contributor
There was a problem hiding this comment.
remove this, this is dangerous
Author
There was a problem hiding this comment.
done. Now constructor will have it instead of setter.
lafa
reviewed
Nov 24, 2019
| } else if (name.equals(STRING_INTERNING_FEATURE)) { | ||
| useIntern = value; | ||
| parserContext.setUseIntern(value); | ||
| // theSchema.setUseIntern(useIntern); |
lafa
reviewed
Nov 24, 2019
| * Get the useIntern flag value. | ||
| * @return useIntern flag value | ||
| */ | ||
| public boolean getUseIntern() { |
lafa
reviewed
Nov 24, 2019
| * Set the use intern flag. | ||
| * @param useIntern whether to use string intern or not | ||
| */ | ||
| public void setUseIntern(final boolean useIntern) { |
Author
There was a problem hiding this comment.
changed the class to be not final and made the methods final.
lafa
reviewed
Nov 24, 2019
| * @param input the input string. | ||
| * @return reference to the string. | ||
| */ | ||
| public String getReference(final String input) { |
lafa
reviewed
Nov 24, 2019
| /** | ||
| * Clear the state. | ||
| */ | ||
| public void clear() { |
lafa
reviewed
Nov 24, 2019
| */ | ||
| protected void setUseIntern(final boolean useIntern) { | ||
| this.useIntern = useIntern; | ||
| public ParserContext getParserContext() { |
lafa
reviewed
Nov 24, 2019
| * Set the parser context. | ||
| * @param parserContext the context of the parser | ||
| */ | ||
| public void setParserContext(final ParserContext parserContext) { |
Author
There was a problem hiding this comment.
made protected. This method is needed in Parser class to set it on the schema object.
lafa
reviewed
Nov 24, 2019
| /** | ||
| * Clear the state. | ||
| */ | ||
| public void clear() { |
lafa
reviewed
Nov 24, 2019
| <element name='a' type='mixed'> | ||
| <memberOf group='M_INLINE'/> | ||
| <contains group='M_NOLINK'/> | ||
| <contains group='M_BLOCK'/> |
Contributor
There was a problem hiding this comment.
please add UTs for these 3 changes please
Contributor
There was a problem hiding this comment.
I need the comments to explain why are these changes here
Contributor
|
👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.