chore: rename server to api (#7342)
This commit is contained in:
parent
6bee97eb26
commit
fdbe4c2ca6
554 changed files with 39 additions and 43 deletions
27
apps/api/plane/utils/html_processor.py
Normal file
27
apps/api/plane/utils/html_processor.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
from io import StringIO
|
||||
from html.parser import HTMLParser
|
||||
|
||||
|
||||
class MLStripper(HTMLParser):
|
||||
"""
|
||||
Markup Language Stripper
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.reset()
|
||||
self.strict = False
|
||||
self.convert_charrefs = True
|
||||
self.text = StringIO()
|
||||
|
||||
def handle_data(self, d):
|
||||
self.text.write(d)
|
||||
|
||||
def get_data(self):
|
||||
return self.text.getvalue()
|
||||
|
||||
|
||||
def strip_tags(html):
|
||||
s = MLStripper()
|
||||
s.feed(html)
|
||||
return s.get_data()
|
||||
Loading…
Add table
Add a link
Reference in a new issue