diff --git a/README.md b/README.md index e3e6852..84c1aa6 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,8 @@ Bidify helps to add bidirectional text support to HTML documents. -The project is in its very early stage of development and its interface or functionality may break from one version to another. Use it with caution. +The project is in its very early stage of development, and its interface or +functionality may break from one version to another. Use it with caution. ## Usage @@ -16,16 +17,14 @@ bidified_html = Bidify.bidify_html_string(html_input) ## Rules -The `dir="auto"` attribute should be applied on "bidifiable" tags as per the following rules: +Bidification (the `dir="auto"` attribute) follows these simple rules: -- Only apply on "bidifiable" tags. -- All top-level elements -- All child elements except the first child +- It applies to "bidifiable" tags. +- It excludes the first immediate child element. +- It excludes `li` tags. -Bidifiable elements can be defined as per the use case requirements (not yet implemented). -The default bidifiable tags are: `div`, `h1`, `h2`, `h3`, `h4`, `h5`, `h6`, `p`, `ul`, `ol`, `blockquote`. - -Notice that `li` elements shouldn't get `dir=auto` otherwise, the list appearance gets damaged. +The default bidifiable tags are `div`, `h1`, `h2`, `h3`, `h4`, `h5`, `h6`, +`p`, `ul`, `ol`, and `blockquote`. One can modify this list using options. As a complementary step, CSS styles should use [logical properties](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_logical_properties_and_values). Here are a few examples: @@ -57,15 +56,18 @@ puts bidifier.apply('
input stringified html
') ### Options -The following is the list of options with their default values +Available options with their default values are as follows: + - `greedy: false` By default, bidification stops when it reaches an element that has `dir` attribute. Use `true` to disregard any existing `dir` attributes. + - `with_table_support: false` Use `true` to add table tags support. ## License -This project is a Free/Libre and Open Source software released under LGPLv3 license. +This project is a Free/Libre and Open Source software released under LGPLv3 +license.