The problem is solved. Question and answer: If the article abstract is too wide vertically, it will run outside. How to control this change and change the css? Solution: Modify the css to make the text wrap automatically How to clear the format of the article abstract Solution: When rendering the article summary in the template, add jinja's filter striptag to remove the html tag, so that you can get a plain text article summary
When displaying the summary, replace the format tags inside...such as <p> these. . It can be replaced when the backend outputs data. . Also see if you can write js to replace it
First of all, this should be a front-end problem, not a back-end problem, which means this should not be a problem between Flask and Python.
Secondly, what you need to understand is the "box" in the HTMlCSS concept. If the text exceeds the width, you can try the css property of text wrapping.
Then you mentioned that your summary was partially intercepted using python slicing, so the original data still contains the format, is it in Html format? If it is a format problem, you can try to filter one side of the original data in a regular way.
You can refer to one of my projects mdwiki, which is also made by flask. The interface is based on my aesthetics, written purely in markdown. https://github.com/xbynet/mdwiki
The problem is solved. Question and answer:
If the article abstract is too wide vertically, it will run outside. How to control this change and change the css?
Solution: Modify the css to make the text wrap automatically
How to clear the format of the article abstract
Solution: When rendering the article summary in the template, add jinja's filter striptag to remove the html tag, so that you can get a plain text article summary
This is really worrying. I was going to use Django to build a material management system, but I got stuck as soon as I started.
When displaying the summary, replace the format tags inside...such as <p>
these. . It can be replaced when the backend outputs data. . Also see if you can write js to replace it
First of all, this should be a front-end problem, not a back-end problem, which means this should not be a problem between Flask and Python.
Secondly, what you need to understand is the "box" in the HTMlCSS concept.
If the text exceeds the width, you can try the css property of text wrapping.
Then you mentioned that your summary was partially intercepted using python slicing, so the original data still contains the format, is it in Html format?
If it is a format problem, you can try to filter one side of the original data in a regular way.
It should be a css problem
Try it
overflow: hidden;
overflow
You can refer to one of my projects mdwiki, which is also made by flask.
The interface is based on my aesthetics, written purely in markdown.
https://github.com/xbynet/mdwiki
Why did I find that it is still ugly after the change? You can check out my blog. I am satisfied with the style. The source code is on github