=== Urdu Text Fixer ===
Contributors:      Umair-khurshid
Donate link:       https://buymeacoffee.com/umairkhurshid
Tags:              urdu, rtl, arabic, persian, editor
Requires at least: 5.8
Tested up to:      6.9
Requires PHP:      7.4
Stable tag:        1.1.1
License:           GPLv2 
License URI:       https://www.gnu.org/licenses/gpl-2.0.html

Auto-detects Urdu, Persian, and Arabic text in the editor and applies RTL formatting with proper bidirectional support for numbers and English.

== Description ==

Urdu Text Fixer makes writing Urdu, Persian, and Arabic content in WordPress effortless.  It automatically detects Arabic‑script text (Urdu, Persian, Arabic, Pashto, and others) in both the Block Editor (Gutenberg) and the Classic Editor (TinyMCE) and switches the editing area to right‑to‑left (RTL) mode.

**Mixed bidirectional content**:
English words, Western‑Arabic digits, and punctuation like `! , "" () -` embedded in Arabic‑script text are automatically wrapped with Unicode bidirectional isolation markers so they render left‑to‑right inside the surrounding RTL context.
**No configuration needed**:
The plugin works out of the box.  A toggle in the Document Settings panel (Block Editor) or a toolbar button (Classic Editor) lets you disable auto‑detection if needed.

### Features

- **Auto‑detection** 
Recognises Arabic‑script characters as you type or paste
- **Classic Editor support** 
A TinyMCE plugin with a toolbar button and live RTL switching
- **Bidirectional text fixing** 
English words, numbers, and special characters are wrapped in Unicode LRI/PDI isolation markers during save and display
- **Front‑end rendering** 
Arabic‑script posts are wrapped in `<div dir="rtl">` so they display correctly on the public site
- **Comments support** 
Arabic‑script comments also receive RTL treatment
- **HTML‑safe**  
Processes only text nodes, leaving HTML tags intact
- **Idempotent** 
Running the fix twice produces the same result; no duplicate markers accumulate

== Installation ==

1. Upload the `urdu-text-fixer` folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the **Plugins** screen in WordPress.
3. Open any post editor and start typing in Urdu, Persian, or Arabic.  Auto‑detection is enabled by default.

= Manual Toggle =
- **Classic Editor:**  An **RTL** button appears on the editor toolbar.

== Frequently Asked Questions ==

= Does the plugin modify my saved post content? =

Yes.  When a post contains Arabic‑script text, Unicode bidirectional isolation markers (invisible characters) are added to English words and numbers so they render correctly inside the RTL context.  These markers are invisible and do not affect the visual appearance of your text.

= Will it affect my existing posts? =

Only if you edit and re‑save them.  Previously published posts are not altered until you update them in the editor.

= Does it work with the Classic Editor plugin? =

Yes,  the Classic Editor (TinyMCE) is fully supported.

= What languages are supported? =

The plugin detects the entire Arabic script Unicode range, supporting Urdu, Persian (Farsi), Arabic, Pashto, Punjabi (Shahmukhi), Sindhi, and any other language written in Arabic‑script.

= Can I disable the auto‑detection? =

Yes.  In the Block Editor, flip the toggle in the *Urdu RTL* document panel.  In the Classic Editor, click the **RTL** toolbar button to switch manually.

== Screenshots ==

1. Without the plugin: Urdu text in the Block Editor with broken alignment.
2. With the plugin: same content properly flowing RTL with character rendering correctly inside the Urdu context.

== Changelog ==

= 1.1.1 =
* Improved Readme

= 1.1.0 =
* Added RTL support for post titles.
* Post titles are now processed for bidirectional text fixing on save and display.
* Urdu post titles automatically switch to RTL direction in both Block and Classic editors.

= 1.0.0 =
* Initial release.
* Auto‑detect Urdu text in Block and Classic editors.
* Bidirectional text fixing with Unicode LRI/PDI isolation markers.
* Front‑end RTL wrapper for posts and comments.



== Upgrade Notice ==
= 1.1.1 =
* Improved Readme. No upgrade needed

= 1.1.0 =
Post title RTL support added.  No upgrade notice required.

= 1.0.0 =
Initial release.  No upgrade needed.
