aboutsummaryrefslogtreecommitdiff
path: root/test/writer.html5
AgeCommit message (Collapse)Author
2025-12-06HTML5 template: conditionally include lang attribute.John MacFarlane
Previously we included it unconditionally, even if this meant giving it an empty value. This seems at best redundant, since the empty value is the default. At worst, it adds clutter and according to some sources may prevent the use of browser defaults. I believe that the justification for including these attributes even with empty values is not a good one; see commit 07d51d9 for the original change. On my reading, the HTML spec does not require the presence of the attribute on the html element; it only says that if the attribute is present, it must have an empty string or valid BCP 47 language tag as its value. See also #11324.
2025-07-29HTML styles: prefix default styles with informative CSS comment (#11002)Albert Krewinkel
Closes #8819
2025-01-14HTML styles: fix style of hr so it works when printed (#10535)Hendrik Erz
Previously `background-color` was used to style the hr, but this gets ignored when printing. This commit uses `border-top` instead.
2023-12-20Remove html5shiv from default HTML5 template.John MacFarlane
I don't think we need to support IE < 9 any more!
2023-12-04HTML5 writer footnote changes (aria-role, element type).John MacFarlane
* To conform to validator's expectations, `doc-footnote` role is used with `aside` and `doc-endnotes` with `section`. * `aside` is used only for notes at ends of sections or blocks; if all the notes come at the end of the document, `section` is used so we can have the `doc-endnotes` role.
2023-08-13Fix tests for change to template in #8999.John MacFarlane
2023-07-26Add clause for svg to default CSS for HTML.John MacFarlane
Suggested at #8969.
2023-03-29styles.html: fix task-list styling in reveal.jsAlbert Krewinkel
Fixes: #8731
2023-03-14HTML writer footnotes changes:John MacFarlane
When `--reference-location=section` or `=block`, use an `aside` element for the notes rather than a `section`. When `--reference-location=section`, include the `aside` element inside the section element, rather than outside. (In slide shows, this option causes footnotes on a slide to be displayed at the bottom of the slide.) Closes #8695.
2023-01-13HTML style template: put Consolas before Lucida Console for code font.John MacFarlane
This is to prevent Lucida Console from being used on Windows, where there seems to be a spacing issue in some applications, with boldface glyphs wider than regular ones. Closes #8543.
2023-01-06Add `code { hyphens: manual; }` to HTML and EPUB CSS.John MacFarlane
Closes #8530.
2022-11-09HTML template: remove default font size, line height...John MacFarlane
...and font family in default inline css. Closes #8423 (see comments there for motivation). `mainfont`, `fontsize`, and `linestretch` can still be used as before; the only difference is that we no longer provide opinionated defaults. This commit also adds a `maxwidth` variable that sets `max-width`; if not set, 36em is used as a default.
2022-11-04Change default background color of PDFs generated via HTML (#8422)Marcin Serwin
* Change default background color of PDFs generated via HTML * Update tests
2022-08-22HTML writer: revert to using `width` property for column widthsAlbert Krewinkel
The default `flex` and `overflow-x` properties of a column are set to `auto`. In combination, these changes allow to get good results when using columns with or without explicit widths.
2022-08-03Improve default CSS for task lists.John MacFarlane
This ensures that there is a space between the checkbox and the following content and that subsequent content lines up. Closes #8151. Supersedes and closes #8163.
2022-08-01HTML: use CSS flex boxes for columns.Albert Krewinkel
This allows to render an arbitrary number of columns, while the previous approach assumed exactly two columns.
2022-07-31Fix tests for d2bd9abc4d5e9b6b4a6414fd010cdb5995f32935John MacFarlane
2022-04-26HTML writer: Add 'footnotes' identifier to footnotes section.John MacFarlane
Closes #8043.
2022-04-21HTML writer: do not include the deprecated doc-endnote role.John MacFarlane
doc-endnote was deprecated in DPUB-ARIA 1.1. Closes #8030.
2022-01-16CSS in HTML template: adjust #TOC and h1 on mobile (#7835)Mauro Bieg
2022-01-10HTML writer: don't break attributes values when wrapping.John MacFarlane
2021-12-22HTML writer: make line breaks more consistent.John MacFarlane
- With `--wrap=none`, we now output line breaks between block-level elements. Previously they were omitted entirely, so the whole document was on one line, unless there were literal line breaks in pre sections. This makes the HTML writer's behavior more consistent with that of other writers. - Put newline after `<dd>`. - Put newlines after block-level elements in footnote section.
2021-12-22Add text wrapping to HTML output.John MacFarlane
Previously the HTML writer was exceptional in not being sensitive to the `--wrap` option. With this change `--wrap` now works for HTML. The default (as with other formats) is automatic wrapping to 72 columns. A new internal module, T.P.Writers.Blaze, exports `layoutMarkup`. This converts a blaze Html structure into a doclayout Doc Text. In addition, we now add a line break between an `img` tag and the associated `figcaption`. Note: Output is never wrapped in `writeHtmlStringForEPUB`. This accords with previous behavior since previously the HTML writer was insensitive to `--wrap` settings. There's no real need to wrap HTML inside a zipped container. Note that the contents of script, textarea, and pre tags are always laid out with the `flush` combinator, so that unwanted spaces won't be introduced if these occur in an indented context in a template. Closes #7764.
2021-09-10Support `--reference-location` for HTML output (#7461)Francesco Mazzoli
The HTML writer now supports `EndOfBlock`, `EndOfSection`, and `EndOfDocument` for reference locations. EPUB and HTML slide show formats are also affected by this change. This works similarly to the markdown writer, but with special care taken to skipping section divs with what regards to the block level. The change also takes care to not modify the output if `EndOfDocument` is used.
2021-07-05document-css: reset overflow-wrap on code blocksMauro Bieg
fixes #7423
2020-11-02Default CSS tweaks.John MacFarlane
These changes restore the 20px font size while increasing readibility by reducing line width. (The number of words per line is now similar to that of pandoc's default LaTeX/PDF output.) With the narrower lines, we also need less interline and interparagraph space, so the content becomes more compact and skimmable: - Change default font size back to 20px. - Set font-size for print media to 12pt. - Reduce interline space. - Reduce interparagraph space. - Reduce line width. - Remove the special `line-height: 1` for table cells, which I had suggested but which now seems a mistake. - Remove the special line-height for pre. - Ensure that there is a bit more space before a heading than after. - Slightly reduced space after title header.
2020-11-01Default CSS: avoid padding and color if monobackgroundcolor not given.John MacFarlane
This makes the default more austere, while putting the padded, colored code elements within easy reach.
2020-11-01Updates to default CSS (#6786)Mauro Bieg
- Fix margin before codeblock - Add `monobackgroundcolor` variable, making the background color and padding of code optional. - Ensure that backgrounds from highlighting styles take precedence over monobackgroundcolor - Remove list markers from TOC - Add margin-bottom where needed - Remove italics from blockquote styling - Change borders and spacing in tables to be more consistent with other output formats - Style h5, h6 - Decrease root font-size to 18px - Update tests for styles.html changes - Add CSS example to MANUAL
2020-09-19Add CSS to default HTML template (#6601)Mauro Bieg
2020-07-01HTML writer: improve alt-text/caption handling for HTML5Albert Krewinkel
Screen readers read an image's `alt` attribute and the figure caption, both of which come from the same source in pandoc. The figure caption is hidden from screen readers with the `aria-hidden` attribute. This improves accessibility. For HTML4, where `aria-hidden` is not allowed, pandoc still uses an empty `alt` attribute to avoid duplicate contents. Closes: #6491
2020-05-18Use CSS in favor of <br> for display math (#6372)Lila
Some CSS to ensure that display math is displayed centered and on a new line is now included in the default HTML-based templates; this may be overridden if the user wants a different behavior.
2019-12-05HTML-based templates: Add CSS to suppress bullet on unordered task lists.John MacFarlane
2019-09-08Replace Element and makeHierarchical with makeSections.John MacFarlane
Text.Pandoc.Shared: + Remove `Element` type [API change] + Remove `makeHierarchicalize` [API change] + Add `makeSections` [API change] + Export `deLink` [API change] Now that we have Divs, we can use them to represent the structure of sections, and we don't need a special Element type. `makeSections` reorganizes a block list, adding Divs with class `section` around sections, and adding numbering if needed. This change also fixes some longstanding issues recognizing section structure when the document contains Divs. Closes #3057, see also #997. All writers have been changed to use `makeSections`. Note that in the process we have reverted the change c1d058aeb1c6a331a2cc22786ffaab17f7118ccd made in response to #5168, which I'm not completely sure was a good idea. Lua modules have also been adjusted accordingly. Existing lua filters that use `hierarchicalize` will need to be rewritten to use `make_sections`.
2019-09-05Add div.hanging-indent CSS to HTML templates.John MacFarlane
2019-09-05Add partial styles.html in HTML5 template.John MacFarlane
Avoid duplication in HTML templates by using styles.html partial. Change indentation of styles in template.
2019-05-28HTML writer: emit empty alt tag in figures (#5518)Mauro Bieg
The same text is already in the <figcaption> and screen-readers would read it twice, see #4737
2019-04-30HTML: prevent gratuitious emojification on iOS.John MacFarlane
iOS chooses to render a number of Unicode entities, including '↩', as big colorful emoji. This can be defeated by appending Unicode VARIATION SELECTOR-15'/'VARIATION SELECTOR-16'. So we now append this character when escaping strings, for both '↩' and '↔'. If other characters prove problematic, they can simply be added to needsVariationSelector. Closes #5469.
2019-02-25Shared.compactify: Avoid mixed lists.John MacFarlane
This improves on the original fix to #5285 by preventing other mixed lists (lists with a mix of Plain and Para elements) that were allowed given the original fix.
2019-02-02HTML5 writer: implement WAI-ARIA roles for (end)notes.John MacFarlane
See #4213.
2018-12-14Remove unnecessary type="text/css" on style and link for HTML5.John MacFarlane
Closes #5146.
2018-09-19Markdown reader: distinguish autolinks in the AST.John MacFarlane
With this change, autolinks are parsed as Links with the `uri` class. (The same is true for bare links, if the `autolink_bare_uris` extension is enabled.) Email autolinks are parsed as Links with the `email` class. This allows the distinction to be represented in the URI. Formerly the `uri` class was added to autolinks by the HTML writer, but it had to guess what was an autolink and could not distinguish `[http://example.com](http://example.com)` from `<http://example.com>`. It also incorrectly recognized `[pandoc](pandoc)` as an autolink. Now the HTML writer simply passes through the `uri` attribute if it is present, but does not add anything. The Textile writer has been modified so that the `uri` class is not explicitly added for autolinks, even if it is present. Closes #4913.
2018-09-10Make HTML5 header easier to style precisely in default template (#4767)J. B. Rainsberger
Add the `title-block-header` identifier to the `header` element, to make it easier to style precisely.
2017-12-26HTML writer: Use br elements in line blocks...John MacFarlane
instead of relying on CSS. Closes #4162. HTML-based templates have had the custom CSS for div.line-block removed. Those maintaining custom templates will want to remove this too. We still enclose line blocks in a div with class line-block.
2017-12-03Include default CSS for 'underline' class in HTML-based templates.John MacFarlane
2017-11-02Improved support for columns in HTML.John MacFarlane
* Move as much as possible to the CSS in the template. * Ensure that all the HTML-based templates (including epub) contain the CSS for columns. * Columns default to 50% width unless they are given a width attribute. Closes #4028.
2017-10-31HTML Writer: consistently use dashed class-namesmb21
see #3556
2017-08-14Implement multicolumn support for slide formats.John MacFarlane
The structure expected is: <div class="columns"> <div class="column" width="40%"> contents... </div> <div class="column" width="60%"> contents... </div> </div> Support has been added for beamer and all HTML slide formats. Closes #1710. Note: later we could add a more elegant way to create this structure in Markdown than to use raw HTML div elements. This would come for free with a "native div syntax" (#168). Or we could devise something specific to slides
2017-05-25Added `spaced_reference_links` extension.John MacFarlane
This is now the default for pandoc's Markdown. It allows whitespace between the two parts of a reference link: e.g. [a] [b] [b]: url This is now forbidden by default. Closes #2602.
2017-04-25HTML line block: Use class instead of style attribute.John MacFarlane
We now issue `<div class="line-block">` and include a default definition for `line-block` in the default templates, instead of hard-coding a `style` on the div. Closes #1623.
2017-04-03Add class to footnote back referencesTimm Albers
The HTML writer now also adds the class footnoteBack to back references of footnotes. This allows for easier CSS styling.