Skip to content

[9.0] [MIG] html_text module - #625

Merged
pedrobaeza merged 3 commits into
OCA:9.0from
Tecnativa:9.0-mig-html_text
Dec 7, 2016
Merged

[9.0] [MIG] html_text module#625
pedrobaeza merged 3 commits into
OCA:9.0from
Tecnativa:9.0-mig-html_text

Conversation

@cubells

@cubells cubells commented Nov 28, 2016

Copy link
Copy Markdown
Member
  • Updated README.rst

@Tecnativa

yajo and others added 3 commits November 28, 2016 11:05
* [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.
 * Updated README.rst
@pedrobaeza pedrobaeza mentioned this pull request Nov 28, 2016
59 tasks

@tarteo tarteo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Just a question

return ""

# Get words
words = u"".join(doc.xpath("//text()")).split()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you join and split after? Isn't it possible to do this: doc.xpath("//text()").split() ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because you can have several text elements. They are joined, and then split by words.

@pedrobaeza
pedrobaeza merged commit 75143b4 into OCA:9.0 Dec 7, 2016
@pedrobaeza
pedrobaeza deleted the 9.0-mig-html_text branch December 7, 2016 16:56
SiesslPhillip pushed a commit to grueneerde/OCA-server-tools that referenced this pull request Nov 20, 2024
Syncing from upstream OCA/server-tools (13.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants