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

Combining <num> with <gap> and @rend="tick" #35

Open
samosafuz opened this issue Feb 27, 2023 · 2 comments
Open

Combining <num> with <gap> and @rend="tick" #35

samosafuz opened this issue Feb 27, 2023 · 2 comments
Assignees

Comments

@samosafuz
Copy link
Member

In the course of encoding some mathematical papyri, I've discovered a gap in XSugar that it would be nice to fill. If we are dealing with a multi-digit whole number or fraction and one of the digits is in a <gap>, it is not possible to add @rend="tick" to <num> without breaking XSugar.

So, for example, we might consider the following. This first scenario behaves as expected, with XSugar conversion from xml to Leiden+ and back.

  • κ[.] (= print)
  • <#κ[.1]=21-29#> (= Leiden+)
  • <num atLeast="21" atMost="29">κ<gap reason="lost" quantity="1" unit="character"/></num> (= xml)

The addition of a tick is problematic because XSugar does not recognize it in the vicinity of <gap>, as the xml indicates

  • κ[.] ´ (= print)
  • <#κ[.1] '=21-29#> (= Leiden+)
  • <num atLeast="21" atMost="29">κ<gap reason="lost" quantity="1" unit="character"/> '</num> (= xml)

Of course, one can add @rend="tick" manually to the xml, but although this displays correctly in PN or in PE under 'preview', it breaks Leiden+, rendering the file broken for future editors.

This bug persists regardless of the position of <gap>; no matter which digit is lacunose, XSugar fails to process the tick properly

@ryanfb ryanfb self-assigned this Feb 28, 2023
@ryanfb
Copy link
Member

ryanfb commented Feb 28, 2023

I think this particular issue is happening because we don't have a grammar rule for combining @rend=tick with @atMost/@atLeast—so the @atMost/@atLeast grammar rule gets triggered and treats the tick like content text. I think I just need to add an ordered rule above the existing @atMost/@atLeast rules that adds a @rend=tick rule so that it will be consumed first.

@samosafuz
Copy link
Member Author

I should have known it was something niche and not something more ordinary. If it's an easy fix that's great; if not I doubt it's one we'll encounter too frequently since @atMost/Least isn't especially common in our number markup.

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