Feature #8121
closedAllow overriding direction of part of text
Description
There should be a way to override direction of part of text. Maybe using <span dir="rtl"> and <p dir="rtl"> (needs permitting use of "dir" HTML attribute and/or "direction" CSS attribute) or even better some nicer shorter Textile-ful syntax.
Upstream Textile supports <span dir="rtl">. It also supports another trick using CSS, but just for a complete paragraph (not some part of it):
This one doesn't work in Redmine too.
An example (paste it in some RTL context and view there):
In this example "C++" is shown as "++C" in an RTL context, while it should be shown like result of the following HTML snippet:
(The "C++" example is a simple one to show the problem. I'm aware of workaround of writing it as "++C", but that's just a workaround. And even if someone prefers to go the workaround way, working around more complex examples can be very more difficult.)
Updated by jayaram nagarkoti over 15 years ago
- Assignee set to Anonymous
Updated by Etienne Massip over 15 years ago
- Assignee deleted (
Anonymous)
Updated by Etienne Massip over 15 years ago
- Tracker changed from Defect to Feature
Updated by Ebrahim Mohammadi over 15 years ago
Updated by Boaz Rymland over 13 years ago
I'd be happy to see this one implemented. TIA!
Updated by Ali Nadalizadeh almost 12 years ago
Temporary fix for persian users which converts the whole wiki paragraph to RTL (once detects persian/arabic content):
<script>
$(document).ready(function() {
$.each($(".wiki, .wiki-edit"), function(i,v){
var txt = $(v).text();
for(ci in txt) {
if (txt.charCodeAt(ci) > 0x600 && txt.charCodeAt(ci) < 0x700) {
$(v).css("direction", "rtl");
break;
}
}
});
$.each($(".issue .subject a"), function(i,v){
var txt = $(v).text();
console.log(txt);
for(ci in txt) {
if (txt.charCodeAt(ci) > 0x600 && txt.charCodeAt(ci) < 0x700) {
$(v).parent().css("direction", "rtl");
$(v).parent().css("text-align", "right");
break;
}
}
});
});
</script>
Append the code above to the main layout file (app/views/layouts/base.html.erb) or any other javascript file which is included in all pages.
Updated by Boaz Rymland almost 12 years ago
Thanks for sharing, Ali!
Updated by Jean-Philippe Lang almost 12 years ago
- Status changed from New to Closed
- Assignee set to Jean-Philippe Lang
- Target version set to 3.0.0
- Resolution set to Fixed
2 builtin css classes (rtl and ltr) are added in r13951.
You can use them with textile formatting by using parenthesis, here on a paragraph and a span:
Updated by Hooman Valibeigi almost 9 years ago
Jean-Philippe Lang wrote:
2 builtin css classes (rtl and ltr) are added in r13951.
You can use them with textile formatting by using parenthesis, here on a paragraph and a span:[...]
This fix is broken.
My environment: Redmine 3.4.2, Google Chrome 63
Take this example:
Textile:
Generated html:
First of all there is no such class as "wiki-class-rtl" in application.css.
Second, "unicode-bidi:bidi-override" makes the LTR parts of an RTL paragraph printed in reverse. e.g. 'tset' instead of 'test'. Simply having direction:rtl would make everything work just fine.
Updated by Toshi MARUYAMA almost 9 years ago
Updated by Jean-Philippe Lang over 8 years ago
- Related to Defect #27884: RTL wiki class broken in Redmine 3.2.6 added