GithubHelp home page GithubHelp logo

bidi-js's People

Contributors

gztchan avatar lojjic avatar nmtigor avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

bidi-js's Issues

getReorderedString of mixed RTL, LTR and Emoji text sometimes differs from browser bidi behavior

When passing a mixed RTL, LTR and Emoji string to getReorderedString, if the sentence is processed as rtl, and the emoji is right after an LTR block it seems like it will be considered as a part of the LTR block, while the browser seems to considers it as a new RTL block (I'm not sure I'm 100% familiar with the implementation to use the right terms here):

if the original string is
RRR LLL N (where N is the Emoji)
The browser will Render it (in a "direction: rtl" block) as
N LLL RRR
but bidi.js will return
LLL N RRR

if the original string is
RRR LLL R N
both the browser and bidi.js will render it as
N R LLL RRR

a codepen demo:
https://codepen.io/tombigel/pen/gOJYQom

Is it expected?

UMD build

Need a UMD-wrapped build file for use in non-ES modules environments.

reorder string to get the result as on the screen

Hi, need some help, please.
I'm dealing with combined LTR, RTL strings, with digits, symbols, arabic, latin, etc
I'm wondering is it possible to reorder a string value from the <input dir="rtr"> into a string that is actually displayed in the html element

I mean if I have in input
image
the value of the input is
image

How can I process the input string value to have a string with characters in an order as I see looking at the input

I tried bidi.getReorderedString method and it works cool for such cases:
image
in the case above the result of the method is exactly what i expect

but if I have arabic chars, then arabic characters are reversed after calling bidi.getReorderedString

Docs

Need to add some usage docs to the README.

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.