question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extracting content by intercepting render_raw_text

See original GitHub issue

Thanks for this nice project.

I may be a noob in this, but I was able to parse a readme get the returned content wrapper in their html elements. But the returned content is one giant text. So, my question is: is there any built-in function to extract only contents but not codes? as in get only data from …<p></p> or <h5></h5>

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
miyuchinacommented, Nov 18, 2017

Oops sorry about that. There are some changes re: renderer’s handling of footnotes that haven’t been updated to pypi yet (see commit 95af86e). I’ll prepare a release soon.

If you clone the repo directly (mistletoe v0.4) the above code should work. If you installed by pypi (mistletoe v0.3.1) you need to define render_raw_text with an additional footnotes argument:

def render_raw_text(self, token, footnotes):
    ...

All other code stays the same.

Sorry about that, and watch for the recent v0.4 release to get rid of the footnotes argument!

0reactions
samayocommented, Dec 9, 2017

Ah, ok thanks. I will check this out, closing for now. Also, I added the second python in the code block so I can render the example, otherwise I am only using the first example as others do 😃

cheers

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extracting an attribute value with beautifulsoup - Stack Overflow
I am trying to extract the content of a single "value" attribute in a specific "input" tag on a webpage. I use the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found