Skip to content

Anomalous HTML line break for inline equations within quotes or followed by punctuation #5920

@pglpm

Description

@pglpm

Bug description

In HTML output, an inline formula within quotes, for example some text "$a=b$" some text or some text $a=b$, some text may at times get a line break right after the initial quote, or right before the final quote or comma or full-stop.

Steps to reproduce

  1. Save this example document testquotes.qmd:
---
title: "Test quotes"
format:
  html:
    html-math-method: mathjax
---

test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" test "$a=b$" 

test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$, test $a=b$,
  1. Render the document to HTML:
quarto render testquotes.qmd --to html
  1. Open the rendered HTML file testquotes.html in a browser. Browsers tested: Firefox 114.0.1 (64-bit), Chromium 114.0.5735.106 (Official Build) snap (64-bit) on Ubuntu 20.04.

  2. Slowly resize the browser window, enlarging or shrinking it, paying attention at where the adapted line breaks appear. You should be able to see the situation as in this screenshot; see the purple squares:
    html_output

Expected behavior

Line breaks shouldn't occurr after opening quotes, or before closing quotes or commas or full-stops.

Actual behavior

Line breaks sometimes occurr after opening quotes, or before closing quotes or commas or full-stops around an inline equation.

Your environment

  • IDE: GNU Emacs 28.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2022-07-28
  • OS: Ubuntu 20.04 64-bit, Kernel Version: 5.14.0-1059-oem

Quarto check output

[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.1: OK
      Dart Sass version 1.55.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.3.353
      Path: /opt/quarto/bin

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.8.10
      Path: /usr/bin/python3
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with python3 -m pip install jupyter

[✓] Checking R installation...........OK
      Version: 4.3.0
      Path: /usr/lib/R
      LibPaths:
        - /usr/local/lib/R/site-library
        - /usr/lib/R/site-library
        - /usr/lib/R/library
      knitr: 1.43
      rmarkdown: 2.22

[✓] Checking Knitr engine render......OK

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghtmlIssues with HTML and related web technology (html/css/scss/js)mathany issue related to math support in specific formatspandoc-luaIssues with our Lua helper functions, filters, etc. in Pandoc

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions