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.
Commit
5e5732f1d92c6fc0da9bf678cd8bb87afb67a5c8124e3ec57f0fc8387ed34a7d
Parent
ddeba72d13ddc12…
2 files changed
+6
-1
+3
-3
+6
-1
| --- skins/default/css.txt | ||
| +++ skins/default/css.txt | ||
| @@ -381,11 +381,10 @@ | ||
| 381 | 381 | .doc > .content th, |
| 382 | 382 | .wiki > .content th { |
| 383 | 383 | border-bottom: 1px solid #dee8f2; |
| 384 | 384 | padding-bottom: 4px; |
| 385 | 385 | padding-right: 6px; |
| 386 | - text-align: left; | |
| 387 | 386 | } |
| 388 | 387 | .artifact > .content tr > th, |
| 389 | 388 | .dir > .content tr > th, |
| 390 | 389 | .doc > .content tr > th, |
| 391 | 390 | .wiki > .content tr > th { |
| @@ -401,10 +400,16 @@ | ||
| 401 | 400 | .dir > .content td, |
| 402 | 401 | .doc > .content td, |
| 403 | 402 | .wiki > .content td { |
| 404 | 403 | padding-bottom: 4px; |
| 405 | 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. */ | |
| 406 | 411 | text-align: left; |
| 407 | 412 | } |
| 408 | 413 | |
| 409 | 414 | /* Wiki adjustments */ |
| 410 | 415 | pre.verbatim { |
| 411 | 416 |
| --- 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 |
+3
-3
| --- src/markdown_html.c | ||
| +++ src/markdown_html.c | ||
| @@ -306,19 +306,19 @@ | ||
| 306 | 306 | }else{ |
| 307 | 307 | blob_append_literal(ob, " <td"); |
| 308 | 308 | } |
| 309 | 309 | switch( flags & MKD_CELL_ALIGN_MASK ){ |
| 310 | 310 | case MKD_CELL_ALIGN_LEFT: { |
| 311 | - blob_append_literal(ob, " align=\"left\""); | |
| 311 | + blob_append_literal(ob, " style=\"text-align:left\""); | |
| 312 | 312 | break; |
| 313 | 313 | } |
| 314 | 314 | case MKD_CELL_ALIGN_RIGHT: { |
| 315 | - blob_append_literal(ob, " align=\"right\""); | |
| 315 | + blob_append_literal(ob, " style=\"text-align:right\""); | |
| 316 | 316 | break; |
| 317 | 317 | } |
| 318 | 318 | case MKD_CELL_ALIGN_CENTER: { |
| 319 | - blob_append_literal(ob, " align=\"center\""); | |
| 319 | + blob_append_literal(ob, " style=\"text-align:center\""); | |
| 320 | 320 | break; |
| 321 | 321 | } |
| 322 | 322 | } |
| 323 | 323 | blob_append_literal(ob, ">"); |
| 324 | 324 | blob_appendb(ob, text); |
| 325 | 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, " 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 |