Update app.py
Browse files
app.py
CHANGED
|
@@ -20,6 +20,31 @@ import html
|
|
| 20 |
import time
|
| 21 |
tool = language_tool_python.LanguageTool('de-DE')
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
bad_string ="""<span style="color: red; text-decoration: underline;" title="Möglicher Tippfehler gefunden. (Vorschläge: Page, Lage, Tage)">page</span>"""
|
| 24 |
|
| 25 |
css = """
|
|
@@ -49,7 +74,7 @@ def replace_markdown_images(text):
|
|
| 49 |
|
| 50 |
replacement = '<img src="dummy.svg">'
|
| 51 |
|
| 52 |
-
return re.sub(pattern,
|
| 53 |
|
| 54 |
def remove_hashes(text):
|
| 55 |
# Remove all '#' characters
|
|
|
|
| 20 |
import time
|
| 21 |
tool = language_tool_python.LanguageTool('de-DE')
|
| 22 |
|
| 23 |
+
|
| 24 |
+
dummy = """
|
| 25 |
+
<svg width="400" height="250" viewBox="0 0 800 500" xmlns="http://www.w3.org/2000/svg">
|
| 26 |
+
<rect width="100%" height="100%" fill="#f2f2f2"/>
|
| 27 |
+
|
| 28 |
+
<!-- Rahmen -->
|
| 29 |
+
<rect x="20" y="20" width="760" height="460" fill="none" stroke="#000" stroke-width="2"/>
|
| 30 |
+
|
| 31 |
+
<!-- Graue Dummy-Fläche -->
|
| 32 |
+
<rect x="80" y="100" width="640" height="300" fill="#cccccc"/>
|
| 33 |
+
|
| 34 |
+
<!-- Text -->
|
| 35 |
+
<text x="400" y="260" font-family="Arial, Helvetica, sans-serif"
|
| 36 |
+
font-size="48" fill="#333" text-anchor="middle">
|
| 37 |
+
DUMMYBILD
|
| 38 |
+
</text>
|
| 39 |
+
|
| 40 |
+
<!-- Zeitungskopf -->
|
| 41 |
+
<text x="400" y="70" font-family="Georgia, serif"
|
| 42 |
+
font-size="32" fill="#000" text-anchor="middle">
|
| 43 |
+
|
| 44 |
+
</text>
|
| 45 |
+
</svg>
|
| 46 |
+
"""
|
| 47 |
+
|
| 48 |
bad_string ="""<span style="color: red; text-decoration: underline;" title="Möglicher Tippfehler gefunden. (Vorschläge: Page, Lage, Tage)">page</span>"""
|
| 49 |
|
| 50 |
css = """
|
|
|
|
| 74 |
|
| 75 |
replacement = '<img src="dummy.svg">'
|
| 76 |
|
| 77 |
+
return re.sub(pattern, dummy, text)
|
| 78 |
|
| 79 |
def remove_hashes(text):
|
| 80 |
# Remove all '#' characters
|