Giter Site home page Giter Site logo

renehamburger / blinx.js Goto Github PK

View Code? Open in Web Editor NEW
18.0 18.0 6.0 5.36 MB

A multi-language client-side script to automatically convert Bible references to Bible links with a passage pop-up

License: MIT License

JavaScript 52.59% HTML 13.82% TypeScript 31.75% CSS 1.77% Shell 0.07%

blinx.js's People

Contributors

dependabot[bot] avatar maartentibau avatar rene-leanix avatar renehamburger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

blinx.js's Issues

False positives

In the string 'Josua, Richter, 1. und 2. Samuel und 1. und 2. Könige', both 'Richter, 1' and 'Samuel und 1' are wrongly interpreted as references.

Improve handling of chapter-less contexts

There are two issues with the current implementation, which can be seen in

it('works for reference without chapter (initial implementation)', async () => {
await testRecognition(
`<p data-bx-context="Matt">
Check out verse 9 and then 6:10 (cf. Luke 11:2)
and verse 11.
</p>`,
['verse 9', '6:10', 'Luke 11:2', 'verse 11'],
['Matt.1.9', 'Matt.6.10', 'Luke.11.2', 'Matt.1.11']
);
});
xit('works for reference without chapter (final implementation)', async () => {
await testRecognition(
`<p data-bx-context="Matt">
Check out verse 9 and then 6:10 (cf. Luke 11:2)
and verse 11.
</p>`,
['6:10', 'Luke 11:2', 'verse 11'],
['Matt.6.10', 'Luke.11.2', 'Matt.6.11']
);
});

As the given context does not contain a chapter:

  • chapter-less references within the section should take their chapter from any previously recognised passage in that section (rather than the chapter 1 supplied to the chapter-less context to allow parsing)
  • if a chapter-less reference has no preceding recognised passage, it should be skipped

Improvements to handling of partial references

Partial references should not trump later complete references

In the following text, the second partial reference takes its context not from the preceeding (complete) reference, but the partial one before that:

Verse 14–15 (vgl. 2. Mose 20,1–3) ... in den Versen 16–20?

(EDIT: This was probably due to a provided context, so works as expected.)

This seems to be the opposite problem of the previous: Partial references with contexts should also be used to provide the context for following partial references:

In <bx context="Rev 21">verse 3</bx> (similar to 1 Peter 1:4) and in verse 4...

Introduce bx-aside

A very common scenario is a longer section about one passage, which has brief references to other books or chapters, e.g. in brackets. At the moment, each one of them changes the context for the following partial references. It would be great to be able to create a separate parsing-context with a tag like <bx-aside> (or even just <bx>) to prevent those references from changing the context for the following partial references.

GetBible-API Update to v2

Wie in der Readme von GetBible aufgelistet, wird der alte API-Aufruf nicht mehr unterstützt, sollte eigentlich schon Ende 2021 abgeschalten werden.

Jetzt sollte man den Pfad über /v2 aufrufen.

https://github.com/getbible/v2

We will keep the old API (the current URL query option on getBible.net) active for another year, ending 2021. We therefore encourage you all to upgrade to the newer, better option, explained below, as soon as you can.

We will always have a Version one (V1) and a Version two ([V2](https://github.com/getbible/v2)) as long as the Lord permits. V1 will return the Holy Scripture in the same format as the original (old API) but with a whole new URL query format, which we will explain in details below. [V2](https://github.com/getbible/v2) will serve as the new format being introduced to solve common issues and provide a better, faster, stronger, more accurate, and convenient API of the Holy Scripture.
How will this work?

The old API query looked like this:

    https://getbible.net/json?passage=1Jn3

The new API (V1) query will look like this:

    https://getbible.net/v1/kjv/62/3.json

    That is really the only change, but we trust it will serve us all better.

[V2](https://github.com/getbible/v2) query will look like this:

    https://getbible.net/v2/kjv/62/3.json

Implement simple caching

To start with, just store retrieved passages in API classes for a second hover on the same link. Optionally in localStorage, but then it needs to be possible to invalidate it.

Requests to GetBible V2 API fail due to CORS issue

Upon loading blinx.js the request to the getbible checksum API fails with the following CORS error (Chrome):

Access to XMLHttpRequest at 'https://getbible.net/v2/checksum.json?v=1695667014779' from origin 'https://www.evangelium21.net' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I assume this error was introduced with the migration to the V2 API.

Strangely when I load the checksum API directly in the Browser I can see that it does indeed respond with a Access-Control-Allow-Origin: * header.

Support Soft Hyphens

If the book name of a bible reference contains soft hyphens (&shy; or &#173;) it is not recognized.

Example (HTML):
Ze&shy;phan&shy;iah 3:17

Tests on IE10 unstable

There seems to be a timing issue/race condition, which sometimes leads to the links not being created.

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.