Skip to content

New rule: check for <semantics> #19

Description

@TimArborealis

suggested name: math-semantics

In the guidelines, we instruct that the <semantics> element should not be used unless specifically instructed. Since this markup is sometimes used anyway, we need a rule to check if it occurs. If it has been ordered to include it in a specific book, one can opt out of the rule when running the validator.

What the validator should flag:
The <semantics> element always occurs as the first child of the <math> element, so the validator should look for this. It is then followed by either <annotation> or <annotation-xml>. The validator should catch the following combinations:

  • Occurence of <semantics> as a first child of a <math> element
  • <semantics> with <annotation> as the second child
  • <semantics> with <annotation-xml> as the second child
  • Occurence of <annotation> or <annotation-xml> at all

See test file test_issue_19.epub for example expressions.

@MartheGjelstad, thoughts? (created the issue together with @AntonLMTM )

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions