Comments (5)
I notice that extras are not implemented as separate modules, so this has to be incorporated into lib/markdown2.py. Does this look like a decent feature to justify the acceptance of a PR?
from python-markdown2.
Where do you see this preview information being stored?
There's also pre and post process hooks in the codebase if you wanna import and then subclass the module, then add your own data as you see fit.
Also check out https://github.com/michaelhelmick/lassie/
from python-markdown2.
Thanks for pointing me to lassie
. Basically I want to process markdown (or generated HTML content) and add previews. It has not been decided yet but I think I want to convert paragraphs with a single link to a block with image, title etc. Something like
I see
https://www.cnn.com/2022/12/04/us/power-outage-moore-county-criminal-investigation/index.html
today
will be converted to something like
I see
[ image ] Title
[ image [ author, date, etc
today
from python-markdown2.
Got it. Sounds interesting. But also very specific. Would probably be a worthwhile extra assuming it was built out to allow customization. Not sure if that's worth it for you to work on, but if it were to go down that path, it would probably be accepted.
from python-markdown2.
Sounds interesting. But also very specific ... built out to allow customization.
I am using python-markdown2
to convert user input into HTML in the backend of a website. I am calling markdown2
like
markdown(my_text, extras= { ...})
so I essentially need a hook like
def link_to_preview(link):
return html-based-on-lassie
markdown(my_text, extras={
'link_preview': {
'select': 'single-paragraph',
'processor': link_to_preview
}
}
So that markdown2
will look for particular types of links (in this case single-link-paragraphs) and replace them with results from a user-provided processor.
from python-markdown2.
Related Issues (20)
- Mixed ordered and unordered lists rendering as per spec? HOT 8
- Lists not properly created in paragraphs HOT 1
- Enclosing `fenced-code-blocks` in a `<div>` tag renders incorrect HTML HOT 5
- Incorrect code block conversion HOT 8
- toc: Headings are not found after a html page-break HOT 1
- A ReDoS vulnerability exists in markdown2.py HOT 1
- Mermaid example is not working HOT 5
- Update tests for new Pygments package HOT 4
- The latest version 2.4.7 has abnormal conversion, while version 2.4.6 is normal. HOT 2
- someone help HOT 1
- Support block code HOT 2
- fenced-code-blocks fails with empty blocks HOT 1
- Support for PyMDown Extensions HOT 3
- HTML elements are replaced by hashes HOT 5
- Replace deprecated imp module with importlib HOT 1
- Python code snippet that include comments do not get parsed correctly HOT 4
- 2.4.9 generates bad output for 'An [issue1](issue1) link' HOT 26
- Unordered lists not working when there is no newline between list items and preceding text HOT 2
- Impossible to use stylesheets HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-markdown2.