Merge branch 'feat/v2.18.2-tables-width' for v2.18.2 release
Build Container / build (push) Successful in 9m38s
Build Container / build (push) Successful in 9m38s
This commit is contained in:
commit
52ecf0f713
5 files changed
+45
-4
No files matched your search
@@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [2.18.2] - 2026-11-12
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Tables in notes and articles: words in cells were split mid-word (a narrow
|
||||||
|
first column read "Colo/r", "Blac/k") and cells had no padding or left
|
||||||
|
alignment. Tables now keep words whole and render as a card that fills the
|
||||||
|
column: raised background, rounded border, shaded header row, roomy cells,
|
||||||
|
sans-serif text at reading size, bold first column. Rendered tables are
|
||||||
|
wrapped in `<div class="table-wrap">`, which scrolls sideways on narrow
|
||||||
|
screens.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Public pages are wider: 48rem instead of 40rem (about 85 characters per
|
||||||
|
line at the reading font). Admin pages stay at 60rem.
|
||||||
|
- The site header (title, menu, search) and footer are 60rem wide on every
|
||||||
|
page, so they sit in the same place on public and admin pages; only the
|
||||||
|
content column differs.
|
||||||
|
|
||||||
## [2.18.1] - 2026-11-12
|
## [2.18.1] - 2026-11-12
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|||||||
@@ -468,5 +468,5 @@ def create_app(config=None):
|
|||||||
|
|
||||||
# Package version (Semantic Versioning 2.0.0)
|
# Package version (Semantic Versioning 2.0.0)
|
||||||
# See docs/standards/versioning-strategy.md for details
|
# See docs/standards/versioning-strategy.md for details
|
||||||
__version__ = "2.18.1"
|
__version__ = "2.18.2"
|
||||||
__version_info__ = (2, 18, 1)
|
__version_info__ = (2, 18, 2)
|
||||||
+3
-1
@@ -62,7 +62,9 @@ ALLOWED_ATTRIBUTES = {
|
|||||||
def render_markdown(text: str) -> str:
|
def render_markdown(text: str) -> str:
|
||||||
"""Note Markdown (or HTML) to sanitized HTML"""
|
"""Note Markdown (or HTML) to sanitized HTML"""
|
||||||
html = markdown.markdown(text, extensions=MARKDOWN_EXTENSIONS)
|
html = markdown.markdown(text, extensions=MARKDOWN_EXTENSIONS)
|
||||||
return nh3.clean(html, tags=ALLOWED_TAGS, attributes=ALLOWED_ATTRIBUTES)
|
html = nh3.clean(html, tags=ALLOWED_TAGS, attributes=ALLOWED_ATTRIBUTES)
|
||||||
|
# A wrapper lets a table fill the column yet scroll sideways when too wide (v2.18.2)
|
||||||
|
return re.sub(r"<table\b", '<div class="table-wrap"><table', html).replace("</table>", "</table></div>")
|
||||||
|
|
||||||
|
|
||||||
# Likes, reposts and bookmarks (v2.5.0, v2.9.0)
|
# Likes, reposts and bookmarks (v2.5.0, v2.9.0)
|
||||||
|
|||||||
+13
-1
@@ -8,7 +8,7 @@
|
|||||||
--font-reading: Charter, 'Bitstream Charter', 'Sitka Text', Cambria, 'Noto Serif', Georgia, serif;
|
--font-reading: Charter, 'Bitstream Charter', 'Sitka Text', Cambria, 'Noto Serif', Georgia, serif;
|
||||||
--font-mono: ui-monospace, 'SF Mono', Monaco, Consolas, 'Liberation Mono', monospace;
|
--font-mono: ui-monospace, 'SF Mono', Monaco, Consolas, 'Liberation Mono', monospace;
|
||||||
--spacing-xs: 0.25rem; --spacing-sm: 0.5rem; --spacing-md: 1rem; --spacing-lg: 2rem; --spacing-xl: 4rem;
|
--spacing-xs: 0.25rem; --spacing-sm: 0.5rem; --spacing-md: 1rem; --spacing-lg: 2rem; --spacing-xl: 4rem;
|
||||||
--max-width: 40rem; --border-radius: 6px;
|
--max-width: 48rem; --frame-width: 60rem; --border-radius: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
@@ -40,6 +40,9 @@ pre code { padding: 0; background: none; }
|
|||||||
|
|
||||||
/* Page frame */
|
/* Page frame */
|
||||||
.site-header, main, .site-footer { width: 100%; max-width: var(--max-width); margin-left: auto; margin-right: auto; }
|
.site-header, main, .site-footer { width: 100%; max-width: var(--max-width); margin-left: auto; margin-right: auto; }
|
||||||
|
/* Header and footer share one width on every page, public and admin (v2.18.2);
|
||||||
|
only the content column (main) differs: 48rem to read, 60rem for admin tables. */
|
||||||
|
.site-header, .site-footer { max-width: var(--frame-width); }
|
||||||
main { flex: 1; margin-bottom: var(--spacing-xl); }
|
main { flex: 1; margin-bottom: var(--spacing-xl); }
|
||||||
|
|
||||||
.site-header {
|
.site-header {
|
||||||
@@ -91,6 +94,15 @@ main { flex: 1; margin-bottom: var(--spacing-xl); }
|
|||||||
.e-content blockquote { margin: 0 0 var(--spacing-md); padding-left: var(--spacing-md); border-left: 3px solid var(--color-border); color: var(--color-text-light); }
|
.e-content blockquote { margin: 0 0 var(--spacing-md); padding-left: var(--spacing-md); border-left: 3px solid var(--color-border); color: var(--color-text-light); }
|
||||||
.e-content ul, .e-content ol { margin: 0 0 var(--spacing-md) 1.25rem; }
|
.e-content ul, .e-content ol { margin: 0 0 var(--spacing-md) 1.25rem; }
|
||||||
.e-content img { max-width: 100%; height: auto; }
|
.e-content img { max-width: 100%; height: auto; }
|
||||||
|
/* Tables (v2.18.2): a card that fills the column, in the page's sans font at
|
||||||
|
the reading size; scrolls sideways when wider than the column. Words in
|
||||||
|
cells are never split (overflow-wrap: anywhere above is for long URLs in
|
||||||
|
prose; in a cell it squeezed columns to a few letters). */
|
||||||
|
.e-content .table-wrap { overflow-x: auto; margin: 0 0 var(--spacing-md); background: var(--color-bg-alt); border: 1px solid var(--color-border); border-radius: var(--border-radius); }
|
||||||
|
.e-content table { width: 100%; border-collapse: collapse; font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.6; }
|
||||||
|
.e-content th, .e-content td { padding: 0.9rem 1.25rem; text-align: left; vertical-align: top; overflow-wrap: normal; }
|
||||||
|
.e-content th { font-weight: 600; white-space: nowrap; background: color-mix(in srgb, var(--color-text) 6%, var(--color-bg-alt)); }
|
||||||
|
.e-content td:first-child { font-weight: 600; }
|
||||||
.e-content h1, .e-content h2, .e-content h3 { font-family: var(--font-body); }
|
.e-content h1, .e-content h2, .e-content h3 { font-family: var(--font-body); }
|
||||||
.reaction { margin-bottom: var(--spacing-sm); font-size: 0.9375rem; color: var(--color-text-light); overflow-wrap: anywhere; }
|
.reaction { margin-bottom: var(--spacing-sm); font-size: 0.9375rem; color: var(--color-text-light); overflow-wrap: anywhere; }
|
||||||
.reaction-verb { font-weight: 600; margin-right: 0.25rem; }
|
.reaction-verb { font-weight: 600; margin-right: 0.25rem; }
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
|
||||||
|
def test_tables_get_a_scroll_wrapper():
|
||||||
|
"""v2.18.2: tables are wrapped so they can fill the column and scroll sideways"""
|
||||||
|
from starpunk.models import render_markdown
|
||||||
|
|
||||||
|
html = render_markdown("| Color | Why |\n|---|---|\n| Black | Removal |\n\nAfter")
|
||||||
|
assert html.startswith('<div class="table-wrap"><table>') and "</table></div>" in html
|
||||||
|
assert "<p>After</p>" in html
|
||||||
Reference in new issue
Block a user