-
Notifications
You must be signed in to change notification settings - Fork 47
Wrap a text node in to current or parent node #49
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
Conversation
Feature: Wrap a text node in to current or parent node 新特征: 封装一个纯文本到一个当前或者父节点里 TODO: ... et. not handle yet, create a ElementNode function to handle them? TODO: 一些特殊字符还没有处理, 考虑创建一个ElementNode实例方法处理特殊字符?
|
Could you, please:
Well, 3rd one is pretty cosmetic and have no consequences on how library works, |
|
Please forgive my grammar mistakes.
Limitations
|
msva
left a comment
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.
ping?
| textcontent = string.gsub(textcontent, " ", '') | ||
| if textcontent ~= '' then | ||
| index = index + 1 | ||
| local textTag = ElementNode:new(index, 'text', node, descend, textstart+1, textend) |
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.
I think, that it would be better to rename it to something that will not collide.
What if user will use parser on <text>moo</text>?
On the other hand, we already have _text. So, I guess, it can be something like _textonly, or something like that.
Although, maybe better way would be to move current _text to _content, and make this to be a _text, but it will brake the API 😿
Which variant is more acceptable for you to implement?
Which variant would be more acceptable for you to implement?
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.
I think _content is suitable for _text.
_text is a subset of _content, what do you think?
|
Ping? Sorry for long disappearing, I was having a lot of personal issues :-/ Let's discuss further implementation of that idea? |
|
I'll close it for now, since it is incomptible with current code base now. If you (or someby else) want to continue work on that - feel free to open new PR. |
Feature: Wrap a text node in to current or parent node
新特征: 封装一个纯文本到一个当前或者父节点里
TODO: ... et. not handle yet, create a ElementNode function to
handle them?
TODO: 一些特殊字符还没有处理, 考虑创建一个ElementNode实例方法处理特殊字符?