Post ARUgQKv49B4m6iIS4e by tant@nrw.social
(DIR) More posts by tant@nrw.social
(DIR) Post #ARUdCLjg11hGiqbmPQ by volpeon@mk.vulpes.one
2023-01-10T07:30:01.087Z
0 likes, 0 repeats
Pandoc started inserting ¶s on my website and I have no idea how to get rid of them :drgn_cry:
(DIR) Post #ARUdJ2OmJCZ8mD1Rx2 by finnley@meow.social
2023-01-10T07:30:56Z
0 likes, 0 repeats
@volpeon reverse pp :o
(DIR) Post #ARUdJ2nwnchO2GnYBM by volpeon@mk.vulpes.one
2023-01-10T07:31:13.601Z
0 likes, 0 repeats
@finnley@meow.social :woozy_baa:
(DIR) Post #ARUdxkIgVDPMWDaDs8 by lanodan@queer.hacktivis.me
2023-01-10T07:37:59.872238Z
1 likes, 0 repeats
@volpeon sed :D
(DIR) Post #ARUeB8OkDdQX1MnmYC by tant@nrw.social
2023-01-10T07:33:56Z
0 likes, 0 repeats
@volpeon what was the input and what is the output format?Do you have an small test case?
(DIR) Post #ARUeB9Fv1vxfgHgFQu by volpeon@mk.vulpes.one
2023-01-10T07:40:59.539Z
0 likes, 0 repeats
@tant@nrw.socialIt's pretty complex and boils down top this:- I iterate all pages of my website from the leaves down to the root page- A JSON file is generated of each page that contains metadata and its content.- When traversing up the tree, the JSON files are combined so each page has a complete view of all its child pages- The content is what gets these ¶s. It's stored in the JSON like this: "content": "<p>For work-in-progress art, check out my <a href=\"https://mk.vulpes.one/@volpeon\">Fediverse</a> account.</p>\n"- I think Pandoc inserts the ¶s when reading the JSON files. It detects that the content contains HTML and generates a structure like this: [1] = RawInline (Format "html") "<p>",[2] = Space,[3] = Str "\182",[4] = Space,[5] = Str "\182",[6] = Space,[7] = Str "For",[8] = ..., \182 appears to be ¶
(DIR) Post #ARUf1kDWqyg9NCdswq by volpeon@mk.vulpes.one
2023-01-10T07:50:31.836Z
0 likes, 0 repeats
description = meta.content:filter(function (el) return el.tag ~= "Str" or el.text ~= "¶" end)This feels like a hack but it works :woozy_baa:
(DIR) Post #ARUgQKv49B4m6iIS4e by tant@nrw.social
2023-01-10T08:00:08Z
0 likes, 0 repeats
@volpeon Is the build process somewhere public?
(DIR) Post #ARUgQLMMVguVTN4FcW by volpeon@mk.vulpes.one
2023-01-10T08:06:09.418Z
0 likes, 0 repeats
@tant@nrw.social I found a simple solution, but if you still want to take a look the code is here: https://git.vulpes.one/volpeon.ink/
(DIR) Post #ARYtOM9jWPv6IoQgcK by tant@nrw.social
2023-01-12T08:14:22Z
1 likes, 0 repeats
@volpeon mhh the issue comes from the newlines at the end of the files you create. Jq reads in the newline at EOF and turns it into "\n" when used with --rawfile, when pandoc reads the metafile it must turn the "\n" into the ¶s.The setup is a little bit convoluted and I was not able to fully reproduce it but when you look at the .pages and .meta files you the the "/n" and in later stages the ¶ appear.
(DIR) Post #ARYtOMb1svkpfTCUAC by volpeon@mk.vulpes.one
2023-01-12T08:50:17.774Z
0 likes, 0 repeats
@tant@nrw.social Hey, thanks for looking into this! I checked your theory by removing all \n from the .content files, but it didn't make a difference.I think the culprit is the way Pandoc handles metadata files. The manual says this about the --metadata-file argument: "string scalars in the YAML file will always be parsed as Markdown". (Since the argument accepts JSON, too, I'm sure it applies to them as well)