Coder Social home page Coder Social logo

usfm's People

Contributors

dependabot[bot] avatar jnterry avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

usfm's Issues

Add support for USFM 2.0 style \fig markers

Before USFM 3.0 and the introduction of arbitrary attributes associated with markers, \fig markers used a strict ording of attributes, as follows:

\fig_DESC|FILE|SIZE|LOC|COPY|CAP|REF\fig*

To quote the spec:

Compatibility with USFM 1.x and 2.x: If a USFM parser encounters a list of un-named attributes using a vertical bar separator within \fig ...\fig* these should be interpreted according to the strict USFM 2.x order.

https://ubsicap.github.io/usfm/characters/index.html#usfmc-fig-attr


This will require changing the lexer to not throw errors when multiple | (TokenType.VBar) are encountered in the body of a single marker. We could just keep this change within the lexer and have a special version of parseAttribute which simply implicity knows the names of the attributes based on their position

Refactor More Parsing Logic into Subparsers

The main parser.ts file is getting very big and complicated.

We've split out parsing for footnote and cross reference environments into their own files - but its becoming clear that we are needing to duplicate code in these and the main parser file (eg, for generic text styling markersv (https://ubsicap.github.io/usfm/characters/index.html#special-text)

It would probably be possible to make the code more readable (and also remove duplication) by refactoring these "subparsers" into a resuable modular system, then each parser could be made up of multiple subparsers that can be combined depending on what symbols are allowed in a given environment.

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.