Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: example scope parse result does not contain newlines #41

Open
pysan3 opened this issue Oct 30, 2023 · 1 comment
Open

BUG: example scope parse result does not contain newlines #41

pysan3 opened this issue Oct 30, 2023 · 1 comment

Comments

@pysan3
Copy link

pysan3 commented Oct 30, 2023

Hi, thanks a lot for the amazing work.

As I was writing a pandoc json -> norg converter, I noticed a bug with example scopes that newlines are not included into c.text.

Example

@document.meta
title: tmp_example
description:
authors: takuto
categories:
created: 2023-10-30T18:22:27+0900
updated: 2023-10-30T18:22:28+0900
version: 1.1.1
@end

* Example Is Not Parsed Correctly

  |example
  I am a paragraph segment.
  I am another paragraph segment.
  Together we form a paragraph.
  |end

Result

{
  "pandoc-api-version": [
    1,
    23
  ],
  "meta": {},
  "blocks": [
    {
      "t": "Div",
      "c": [
        [
          "section-h1-example-is-not-parsed-correctly",
          [],
          []
        ],
        [
          {
            "t": "Header",
            "c": [
              1,
              [
                "h1-example-is-not-parsed-correctly",
                [],
                []
              ],
              [
                {
                  "t": "Str",
                  "c": "Example"
                },
                {
                  "t": "Space"
                },
                {
                  "t": "Str",
                  "c": "Is"
                },
                {
                  "t": "Space"
                },
                {
                  "t": "Str",
                  "c": "Not"
                },
                {
                  "t": "Space"
                },
                {
                  "t": "Str",
                  "c": "Parsed"
                },
                {
                  "t": "Space"
                },
                {
                  "t": "Str",
                  "c": "Correctly"
                }
              ]
            ]
          }
        ]
      ]
    },
    {
      "t": "CodeBlock",
      "c": [
        [
          "",
          [
            "norg"
          ],
          []
        ],
        "  I am a paragraph segment.  I am another paragraph segment.  Together we form a paragraph."
      ]
    }
  ]
}

Expected

Newline \n not being ignored.

...
    {
      "t": "CodeBlock",
      "c": [
        [
          "",
          [
            "norg"
          ],
          []
        ],
        "  I am a paragraph segment.\n  I am another paragraph segment.\n  Together we form a paragraph.\n"
      ]
    }
...
@Klafyvel
Copy link
Owner

Klafyvel commented Oct 30, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants