Skip to content

Commit 428254e

Browse files
authored
Merge pull request #12475 from quarto-dev/tables/trim-raw-html
html tables - remove trailing spaces in HTML raw block before parsing
2 parents 0a38e70 + 36cb94d commit 428254e

File tree

7 files changed

+53
-323
lines changed

7 files changed

+53
-323
lines changed

news/changelog-1.7.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ All changes included in 1.7:
164164
- ([#12338](https://github.com/quarto-dev/quarto-cli/issues/12338)): Add an additional workaround for the SCSS parser used in color variable extraction.
165165
- ([#12369](https://github.com/quarto-dev/quarto-cli/pull/12369)): `quarto preview` correctly throws a YAML validation error when a `format` key does not conform.
166166
- ([#12238](https://gijit.com/quarto-dev/quarto-cli/issues/12238)): Very long error (e.g. in Jupyter Notenook with backtrace) are now no more truncated in the console.
167+
- ([#9867](https://github.com/quarto-dev/quarto-cli/issues/9867)): Blank lines are now trimmed in Raw HTML Table blocks.
167168

168169
## Languages
169170

src/resources/filters/crossref/crossref.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ import("../quarto-init/resourcerefs.lua")
6161

6262
import("../normalize/flags.lua")
6363
import("../normalize/normalize.lua")
64-
import("../normalize/parsehtml.lua")
6564
import("../normalize/extractquartodom.lua")
6665
import("../normalize/astpipeline.lua")
6766
import("../normalize/capturereaderstate.lua")

src/resources/filters/main.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ import("./quarto-finalize/typst.lua")
100100

101101
import("./normalize/flags.lua")
102102
import("./normalize/normalize.lua")
103-
import("./normalize/parsehtml.lua")
104103
import("./normalize/extractquartodom.lua")
105104
import("./normalize/astpipeline.lua")
106105
import("./normalize/capturereaderstate.lua")

src/resources/filters/normalize/astpipeline.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ function quarto_ast_pipeline()
112112
end
113113
local function handle_raw_html_as_table(el)
114114
local eltext
115+
-- trim leading and trailing spaces
116+
el.text = el.text:gsub("^%s*(.-)%s*$", "%1")
117+
115118
if(_quarto.format.isTypstOutput()) then
116119
eltext = juice(el.text)
117120
else

src/resources/filters/normalize/parsehtml.lua

Lines changed: 0 additions & 321 deletions
This file was deleted.

0 commit comments

Comments
 (0)