clean internfiles
This commit is contained in:
@@ -4,7 +4,7 @@ from slugify import slugify
|
|||||||
import re
|
import re
|
||||||
from flask import redirect, url_for, send_from_directory
|
from flask import redirect, url_for, send_from_directory
|
||||||
from .pth import pth
|
from .pth import pth
|
||||||
|
import bs4
|
||||||
|
|
||||||
bp = Blueprint("internfiles", __name__, url_prefix="/internfiles")
|
bp = Blueprint("internfiles", __name__, url_prefix="/internfiles")
|
||||||
|
|
||||||
@@ -61,9 +61,10 @@ def web(path=""):
|
|||||||
if f and f.endswith(".txt"):
|
if f and f.endswith(".txt"):
|
||||||
text = os.path.abspath(f)
|
text = os.path.abspath(f)
|
||||||
|
|
||||||
with open(os.path.abspath(f), "r") as fh:
|
with open(os.path.abspath(f), "r", encoding='utf-8') as fh:
|
||||||
text = fh.read()
|
text = (fh.read())
|
||||||
text = re.sub("\\n\s*\\n", "<br>", text)
|
text = re.sub("\\n\s*\\n", "<br>", text)
|
||||||
|
#text=bs4.BeautifulSoup(text).text
|
||||||
elif f:
|
elif f:
|
||||||
return send_from_directory(str(f - 1), str(f[-1]))
|
return send_from_directory(str(f - 1), str(f[-1]))
|
||||||
return render_template("internfiles.html", file=f, dir=d, text=text, path=pth(d.p))
|
return render_template("internfiles.html", file=f, dir=d, text=text, path=pth(d.p))
|
||||||
|
|||||||
@@ -5,17 +5,9 @@
|
|||||||
<ul>
|
<ul>
|
||||||
{% for b in dir.bookmarks %}<li>
|
{% for b in dir.bookmarks %}<li>
|
||||||
<a href="{{url_for('internfiles.web', path=b)}}">
|
<a href="{{url_for('internfiles.web', path=b)}}">
|
||||||
{{b}}</a></li>
|
{{b or "Home"}}</a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
<p>sdf</p>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>asdf</li>
|
|
||||||
</ul>
|
|
||||||
{{file}}
|
|
||||||
{{dir}}
|
|
||||||
{{dir.files}}
|
|
||||||
<h2>Text:</h2>
|
<h2>Text:</h2>
|
||||||
{{text|safe}}<br><br>
|
{{text|safe}}<br><br>
|
||||||
<ul>
|
<ul>
|
||||||
|
|||||||
Reference in New Issue
Block a user