-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
12.0 mig html text #1417
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
12.0 mig html text #1417
Conversation
* [8.0][html_text] Excerpt generator. This module adds a technical utility to allow the developer to get an excerpt from any HTML chunk. You can choose the maximum amount of words or characters if you want. See the README and inline docstrings for further details.
OCA Transbot updated translations from Transifex
OCA Transbot updated translations from Transifex
[FIX] Tests [FIX] Do not test the specific exception [FIX] Do not test the specific exception
|
Hey @Dike90, thank you for your Pull Request. It looks like some users haven't signed our Contributor License Agreement, yet.
Appreciation of efforts, |
|
LGTM |
elicoidal
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.
LGTM
|
@Dike90 have you signed the CLA? |
fkantelberg
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.
Code review
| return "" | ||
|
|
||
| # Get words | ||
| words = u"".join(doc.xpath("//text()")).split() |
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.
This will cause a problem if the html isn't using spaces around tags. e.g. <a>Test</a><b>Hello</b>. Best would be to use a space for joining.
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.
@yajo any thoughts about 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.
I don't agree, because i.e. This is a <b>test</b> still has an ending space after "a". On the other hand My<b>Long</b>Word is still one word.
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.
Then is it correct for all cases?
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.
Yes, it's ok as it is.
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.
You get problems when you use something like <div>, <p> or <td> tags. e.g. <div>Hello,</div><div>Ok</div>. But of course it's probably a edge case and can be fixed with html formatting.
cristinamartinrod
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.
LGTM
Syncing from upstream OCA/server-tools (12.0)
No description provided.