Fossil SCM

Minimal change to MD to HTML styling to allow `:` alignment markers to be obeyed. Without this, the skin's default left alignment takes over because although it's brought in at the head of the document, the body doesn't override it because our CSS selectors are more specific, giving them precedence.

wyoung 2024-09-03 14:56 trunk
Commit 5e5732f1d92c6fc0da9bf678cd8bb87afb67a5c8124e3ec57f0fc8387ed34a7d
--- skins/default/css.txt
+++ skins/default/css.txt
@@ -381,11 +381,10 @@
381381
.doc > .content th,
382382
.wiki > .content th {
383383
border-bottom: 1px solid #dee8f2;
384384
padding-bottom: 4px;
385385
padding-right: 6px;
386
- text-align: left;
387386
}
388387
.artifact > .content tr > th,
389388
.dir > .content tr > th,
390389
.doc > .content tr > th,
391390
.wiki > .content tr > th {
@@ -401,10 +400,16 @@
401400
.dir > .content td,
402401
.doc > .content td,
403402
.wiki > .content td {
404403
padding-bottom: 4px;
405404
padding-right: 6px;
405
+}
406
+th {
407
+ /* Special rule at high level to override default centering of table
408
+ header cell text. If it isn't at this level, it can't be
409
+ overridden in the HTML, as by the MD table generator's handling
410
+ of `:` alignment markers. */
406411
text-align: left;
407412
}
408413
409414
/* Wiki adjustments */
410415
pre.verbatim {
411416
--- skins/default/css.txt
+++ skins/default/css.txt
@@ -381,11 +381,10 @@
381 .doc > .content th,
382 .wiki > .content th {
383 border-bottom: 1px solid #dee8f2;
384 padding-bottom: 4px;
385 padding-right: 6px;
386 text-align: left;
387 }
388 .artifact > .content tr > th,
389 .dir > .content tr > th,
390 .doc > .content tr > th,
391 .wiki > .content tr > th {
@@ -401,10 +400,16 @@
401 .dir > .content td,
402 .doc > .content td,
403 .wiki > .content td {
404 padding-bottom: 4px;
405 padding-right: 6px;
 
 
 
 
 
 
406 text-align: left;
407 }
408
409 /* Wiki adjustments */
410 pre.verbatim {
411
--- skins/default/css.txt
+++ skins/default/css.txt
@@ -381,11 +381,10 @@
381 .doc > .content th,
382 .wiki > .content th {
383 border-bottom: 1px solid #dee8f2;
384 padding-bottom: 4px;
385 padding-right: 6px;
 
386 }
387 .artifact > .content tr > th,
388 .dir > .content tr > th,
389 .doc > .content tr > th,
390 .wiki > .content tr > th {
@@ -401,10 +400,16 @@
400 .dir > .content td,
401 .doc > .content td,
402 .wiki > .content td {
403 padding-bottom: 4px;
404 padding-right: 6px;
405 }
406 th {
407 /* Special rule at high level to override default centering of table
408 header cell text. If it isn't at this level, it can't be
409 overridden in the HTML, as by the MD table generator's handling
410 of `:` alignment markers. */
411 text-align: left;
412 }
413
414 /* Wiki adjustments */
415 pre.verbatim {
416
--- src/markdown_html.c
+++ src/markdown_html.c
@@ -306,19 +306,19 @@
306306
}else{
307307
blob_append_literal(ob, " <td");
308308
}
309309
switch( flags & MKD_CELL_ALIGN_MASK ){
310310
case MKD_CELL_ALIGN_LEFT: {
311
- blob_append_literal(ob, " align=\"left\"");
311
+ blob_append_literal(ob, " style=\"text-align:left\"");
312312
break;
313313
}
314314
case MKD_CELL_ALIGN_RIGHT: {
315
- blob_append_literal(ob, " align=\"right\"");
315
+ blob_append_literal(ob, " style=\"text-align:right\"");
316316
break;
317317
}
318318
case MKD_CELL_ALIGN_CENTER: {
319
- blob_append_literal(ob, " align=\"center\"");
319
+ blob_append_literal(ob, " style=\"text-align:center\"");
320320
break;
321321
}
322322
}
323323
blob_append_literal(ob, ">");
324324
blob_appendb(ob, text);
325325
--- src/markdown_html.c
+++ src/markdown_html.c
@@ -306,19 +306,19 @@
306 }else{
307 blob_append_literal(ob, " <td");
308 }
309 switch( flags & MKD_CELL_ALIGN_MASK ){
310 case MKD_CELL_ALIGN_LEFT: {
311 blob_append_literal(ob, " align=\"left\"");
312 break;
313 }
314 case MKD_CELL_ALIGN_RIGHT: {
315 blob_append_literal(ob, " align=\"right\"");
316 break;
317 }
318 case MKD_CELL_ALIGN_CENTER: {
319 blob_append_literal(ob, " align=\"center\"");
320 break;
321 }
322 }
323 blob_append_literal(ob, ">");
324 blob_appendb(ob, text);
325
--- src/markdown_html.c
+++ src/markdown_html.c
@@ -306,19 +306,19 @@
306 }else{
307 blob_append_literal(ob, " <td");
308 }
309 switch( flags & MKD_CELL_ALIGN_MASK ){
310 case MKD_CELL_ALIGN_LEFT: {
311 blob_append_literal(ob, " style=\"text-align:left\"");
312 break;
313 }
314 case MKD_CELL_ALIGN_RIGHT: {
315 blob_append_literal(ob, " style=\"text-align:right\"");
316 break;
317 }
318 case MKD_CELL_ALIGN_CENTER: {
319 blob_append_literal(ob, " style=\"text-align:center\"");
320 break;
321 }
322 }
323 blob_append_literal(ob, ">");
324 blob_appendb(ob, text);
325

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button