Hello,
Do you have plans for growing this module to support more than only paragraphs?
There is a module which we wrote for, and using at, EGLUG called 'bidi'. Originally written by Alaa with some additional work by msameer. I have an unofficial rewrite of the module as well which uses simplexml instead of string parsing.
Unfortunately, I don't have the latest version of the module as it was never submitted as a project to d.o. But I was wondering if the feature-set of bidi module would be interesting to you (since bidi was never released). It has some interesting features which could be brought to pdir:
- Supports more than just paragraphs. All block level elements are supported (IIRC!).
- Decides the language of the text based on the number of characters not the first character.
- Context-aware. i.e. It will not add the direction for every element, since it's inherited anyway. It will only add it when a direction change is needed.
If the bidi feature-set could be incorporated in pdir, I'd use it instead of the unmaintained bidi.
Now I've been wanting to submit this issue for some time, but the rewritten version of the module which I wrote is hanging on an old storage which is giving some IO errors currently. So I thought I should at least start by this issue and see if any of the features above would make sense to you in pdir.
Cheers
Comments
Comment #1
AmrMostafa commentedComment #2
alaa commentedbidi.module can be found @ my sandbox http://cvs.drupal.org/viewvc.py/drupal/contributions/sandbox/alaa/ not very pretty though, it was never released cause it's a dirty hack.
I just committed jquery_bidi which does a similar thing using jquery.
Comment #3
z.stolar commentedit's a pity I wasn't aware of the module before, I would have probably used some of it's code :)
Few answers:
As for using a different approach for parsing - I'm open for any improvements, but I'd expect some help on this matter, if it is a better approach.
Comment #4
makopolok commentedWhy not to add it for the Headers too ?
Comment #5
z.stolar commented@makopolok: which headers are you referring to?
Comment #6
makopolok commentedHeaders of story.
Somehow the filter is not working for me as expected.
I see the check box in the input type.
Got the feeling that it handle well the periods but got a conflict with the language css for hebrew.
http://jeruchess.com/drupaltst/
It's a very useful filter, hope it can work with hebrew that is on the site level.
Comment #7
z.stolar commented@makopolok: All your paragraphs are aligned in the same way: either left or right. The directionality applies, but not the alignment. Maybe we should consider adding alignment to the filter, as the site-wide alignment is stronger here.
The best method would be to add a setting to the filter, that lets the user decide between a right/left alignment, to "justified".
Comment #8
z.stolar commentedAs alienbrain asked: I'd like to add more block level elements to pdir.
Can you please suggest desired HTML elements?
Currently we support: p, ol, ul, li, div
We have an issue about lists here: #390266: pdir calculates list directionality the wrong way with RTL text
Other tags that can go in: h*, dd, dt, blockquote, cite... What else?
Comment #9
sinasalek commentedI'm the co-maintainer of this module. I might be able to implement this feature. as @z.stolar said which tags you're interested?