mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Fix rendering glitch with columns on mobile, closes #978
This commit is contained in:
parent
1f021c3711
commit
c11383e628
2 changed files with 12 additions and 1 deletions
|
|
@ -271,7 +271,7 @@ _boring_keyword_re = re.compile(r"^[a-zA-Z_][a-zA-Z0-9_]*$")
|
||||||
|
|
||||||
|
|
||||||
def escape_css_string(s):
|
def escape_css_string(s):
|
||||||
return _css_re.sub(lambda m: "\\{:X}".format(ord(m.group())), s)
|
return _css_re.sub(lambda m: "\\" + ("{:X}".format(ord(m.group())).zfill(6)), s)
|
||||||
|
|
||||||
|
|
||||||
def escape_sqlite(s):
|
def escape_sqlite(s):
|
||||||
|
|
|
||||||
|
|
@ -420,6 +420,17 @@ def test_escape_fts(query, expected):
|
||||||
assert expected == utils.escape_fts(query)
|
assert expected == utils.escape_fts(query)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize(
|
||||||
|
"input,expected",
|
||||||
|
[
|
||||||
|
("dog", "dog"),
|
||||||
|
('dateutil_parse("1/2/2020")', r"dateutil_parse(\0000221/2/2020\000022)"),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
def test_escape_css_string(input, expected):
|
||||||
|
assert expected == utils.escape_css_string(input)
|
||||||
|
|
||||||
|
|
||||||
def test_check_connection_spatialite_raises():
|
def test_check_connection_spatialite_raises():
|
||||||
path = str(pathlib.Path(__file__).parent / "spatialite.db")
|
path = str(pathlib.Path(__file__).parent / "spatialite.db")
|
||||||
conn = sqlite3.connect(path)
|
conn = sqlite3.connect(path)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue