Comments (5)
Hello Kevin,
You are indeed right that the inline directive does not work properly inside pandoc-processed pages. Raw inlines do work, e.g.
[[!inline raw="yes" pages="ovipara/vertebrata/aves/*"]]
which means that the plugin is being called at the proper place, but the more common form of inline with archive="yes"
for some reason fails. I will need to look further into this.
from ikiwiki-pandoc.
I have now investigated the issue further. The reason that content is dropped is the somehwat unfortunate method the inline plugin uses for inserting the content into the page:
- In the
preprocess
hook, which happens before the content has been transformed into HTML, it assembles the pages to be rendered and transforms them into HTML. Unless we're dealing with raw or nested inlines, these snippets of HTML are not inserted into the page at once. Instead, the plugin inserts placeholders which look like<div class="inline" id="XX"></div>
, whereXX
the number of the snippet to be placed there. - The markup processor (in our case
pandoc
) now processes the base page, which no longer containsinline
directives, but instead contains these placeholders. - In the
format
hook, the inline plugin comes onto the scene again and replaces the placeholders with their corresponding snippets. This is done with a regular expression replacement.
The problem with this process from our perspective is that pandoc parses and re-outputs the placeholders. In the process, their id
and class
attributes are reversed. As a consequence, the regular expression fails to match and no snippets are in fact inserted.
In my opinion, the placeholder pattern in the inline plugin should be changed so as to prevent such problems, which no doubt affect other plugins as well. But even if this would be done, we still would have to detect inline placeholders in the pandoc plugin before pandoc is run, and protect them somehow from being mangled, since many people will have older versions of the inline plugin which do not contain this putative fix. I'll try to implement this during the weekend.
from ikiwiki-pandoc.
I've now fixed the issue by protecting inline placeholders from being processed by pandoc. The fix is in release v0.4.2.
from ikiwiki-pandoc.
Thanks @bk !
from ikiwiki-pandoc.
Thank you very much!
from ikiwiki-pandoc.
Related Issues (16)
- html5 option seems to be deprecated HOT 2
- img directive doesn't work on pages that are processed by ikiwiki-pandoc HOT 3
- request: add information on how to update the plugin to the readme HOT 1
- Wikilinks easily breaks pandoc-flavoured markdown tables HOT 6
- ikiwiki's style.css breaks pandoc table headers HOT 1
- Regression: Doesn't work anymore with recently updated pandoc 1.18. from homebrew HOT 12
- Inclusion into ikiwiki? Package for debian? HOT 2
- Pandoc YAML metadata block HOT 8
- Regression: --normalize has been removed HOT 3
- Rearrange repo layout so that it's suitable to use with git-submodule
- Support for filters
- Failed to load plugin error on line 286 HOT 4
- Use of uninitialized value […] in pattern match (m//) at […]/pandoc.pm line 269. HOT 4
- pandoc style citations don't work HOT 6
- How to set locale (for bibliography) wiki wide HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ikiwiki-pandoc.