Giter Club home page Giter Club logo

pagebreak's People

Contributors

averms avatar cderv avatar disonantemus avatar ilonasilverwood avatar niszet avatar s22h avatar sje30 avatar tarleb avatar wlupton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pagebreak's Issues

Pagebreak only works with -f markdown (default)

I was trying the filter and didn't work using commonmark_x, until I use -f markdown.
I did use input.md from test samples:

$ pandoc --lua-filter pagebreak.lua input.md -f markdown -t ms > expected.ms
$ pandoc --lua-filter pagebreak.lua input.md -f commonmark_x -t ms > not_expected.ms
$ diff --unified --suppress-common-lines expected.ms not_expected.ms
--- expected.ms 2024-02-21 00:05:06.881878556 -0300
+++ not_expected.ms     2024-02-20 23:40:30.712961487 -0300
@@ -2,7 +2,8 @@
 Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
 Donec hendrerit tempor tellus.
 Donec pretium posuere tellus.
-.bp
+.PP
+\[rs]newpage
 .PP
 Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
 ridiculus mus.

As you can see they're not the same, for -t ms pagebreak should be in both cases .bp.
Same mismatch happens using:

  • gfm
  • commonmark
  • markdown_strict
  • ...

And not just -t ms output, also:

  • context
  • asciidoc
  • html
  • ...

I din't use "expected" files to compare, because clearly they have errors and need to upload again, problems like:

input.md > 1 page break (corrupted maybe?)
expected.adoc > 0 page break
expected.html > 2 page break
expected.context > no exist to compare

$ pacman -Qs pandoc | head -1
local/pandoc-bin 3.1.11-1
$ neofetch --off distro kernel
distro: Arch Linux x86_64
kernel: 6.1.52-1-lts

Allow pagebreaks to be included when converting to Markdown

Can this filter be extended so it can include pagebreaks when converting from supported output formats to Markdown?

I work on a project where I prefer to work in plain text, but others use MS Word for most of their work. We really need as much of the formating to be intact when converting, and especially pagebreaks would be helpful to keep when I convert between the different formats.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.