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

ZERO WIDTH SPACE character is not recongized correctly #98

Closed
RangHo opened this issue Dec 14, 2023 · 1 comment · Fixed by #112
Closed

ZERO WIDTH SPACE character is not recongized correctly #98

RangHo opened this issue Dec 14, 2023 · 1 comment · Fixed by #112

Comments

@RangHo
Copy link

RangHo commented Dec 14, 2023

As per the official documentation, I am using U+200B (ZERO WIDTH SPACE) to break up Org markups in the middle of a "word".

However, current implementation seems to ignore its role as an escape character (or a separator) as below.

The following Org markup, with literal X representing a zero width space character for clarity...

~code~Xhello

=verbatim=Xhello

**bold**Xhello

/italic/Xhello

...should be parsed as...

{
  "type": "org-data",
  "contentsBegin": 0,
  "contentsEnd": 62,
  "children": [
    {
      "type": "paragraph",
      "affiliated": {},
      "contentsBegin": 0,
      "contentsEnd": 13,
      "children": [
        {
          "type": "code",
          "value": "code",
          "children": []
        },
        {
          "type": "text",
          "value": "Xhello\n"
        }
      ]
    },
    {
      "type": "paragraph",
      "affiliated": {},
      "contentsBegin": 14,
      "contentsEnd": 31,
      "children": [
        {
          "type": "verbatim",
          "value": "verbatim",
          "children": []
        },
        {
          "type": "text",
          "value": "Xhello\n"
        }
      ]
    },
    {
      "type": "paragraph",
      "affiliated": {},
      "contentsBegin": 32,
      "contentsEnd": 47,
      "children": [
        {
          "type": "bold",
          "contentsBegin": 33,
          "contentsEnd": 39,
          "children": [
            {
              "type": "bold",
              "contentsBegin": 34,
              "contentsEnd": 38,
              "children": [
                {
                  "type": "text",
                  "value": "bold"
                }
              ]
            }
          ]
        },
        {
          "type": "text",
          "value": "Xhello\n"
        }
      ]
    },
    {
      "type": "paragraph",
      "affiliated": {},
      "contentsBegin": 48,
      "contentsEnd": 62,
      "children": [
        {
          "type": "italic",
          "contentsBegin": 49,
          "contentsEnd": 55,
          "children": [
            {
              "type": "text",
              "value": "italic"
            }
          ]
        },
        {
          "type": "text",
          "value": "Xhello"
        }
      ]
    }
  ]
}

...but the current implementation parses it as...

{
  "type": "org-data",
  "contentsBegin": 0,
  "contentsEnd": 62,
  "children": [
    {
      "type": "paragraph",
      "affiliated": {},
      "contentsBegin": 0,
      "contentsEnd": 13,
      "children": [
        {
          "type": "text",
          "value": "~code~Xhello\n"
        }
      ]
    },
    {
      "type": "paragraph",
      "affiliated": {},
      "contentsBegin": 14,
      "contentsEnd": 31,
      "children": [
        {
          "type": "text",
          "value": "=verbatim=Xhello\n"
        }
      ]
    },
    {
      "type": "paragraph",
      "affiliated": {},
      "contentsBegin": 32,
      "contentsEnd": 47,
      "children": [
        {
          "type": "text",
          "value": "**bold**Xhello\n"
        }
      ]
    },
    {
      "type": "paragraph",
      "affiliated": {},
      "contentsBegin": 48,
      "contentsEnd": 62,
      "children": [
        {
          "type": "text",
          "value": "/italic/Xhello"
        }
      ]
    }
  ]
}
@ispringle
Copy link
Contributor

I suspect this is related to #51

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

Successfully merging a pull request may close this issue.

2 participants