Skip to content

Commit 26181f7

Browse files
author
Emran
committed
Feat: Make post content direction auto
Q2A already supports RTL direction in its settings. But, when switching to a direction (e.g. RTL) the contents of the other direction (LTR) are messed up. Hence, in order to support mixed directions, `dir=auto` got added to the post content `div`s.
1 parent 947a970 commit 26181f7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

qa-include/qa-theme-base.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ public function page_title_error()
743743
if (isset($favorite))
744744
$this->output('<form ' . $favorite['form_tags'] . '>');
745745

746-
$this->output('<div class="qa-main-heading">');
746+
$this->output('<div class="qa-main-heading" dir="auto">');
747747
$this->favorite();
748748
$this->output('<h1>');
749749
$this->title();
@@ -1713,7 +1713,7 @@ public function q_item_clear()
17131713
public function q_item_title($q_item)
17141714
{
17151715
$this->output(
1716-
'<div class="qa-q-item-title">',
1716+
'<div class="qa-q-item-title" dir="auto">',
17171717
'<a href="' . $q_item['url'] . '">' . $q_item['title'] . '</a>',
17181718
// add closed note in title
17191719
empty($q_item['closed']['state']) ? '' : ' [' . $q_item['closed']['state'] . ']',
@@ -2198,7 +2198,7 @@ public function q_view_content($q_view)
21982198
{
21992199
$content = isset($q_view['content']) ? $q_view['content'] : '';
22002200

2201-
$this->output('<div class="qa-q-view-content qa-post-content">');
2201+
$this->output('<div class="qa-q-view-content qa-post-content" dir="auto">');
22022202
$this->output_raw($content);
22032203
$this->output('</div>');
22042204
}
@@ -2361,7 +2361,7 @@ public function a_item_content($a_item)
23612361
$a_item['content'] = '';
23622362
}
23632363

2364-
$this->output('<div class="qa-a-item-content qa-post-content">');
2364+
$this->output('<div class="qa-a-item-content qa-post-content" dir="auto">');
23652365
$this->output_raw($a_item['content']);
23662366
$this->output('</div>');
23672367
}

qa-theme/SnowFlat/qa-theme.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ public function q_item_title($q_item)
364364
: '<img src="' . $this->rooturl . $this->icon_url . '/closed-q-list.png" class="qam-q-list-close-icon" alt="' . $closedText . '" title="' . $closedText . '"/>';
365365

366366
$this->output(
367-
'<div class="qa-q-item-title">',
367+
'<div class="qa-q-item-title" dir="auto">',
368368
// add closed note in title
369369
$imgHtml,
370370
'<a href="' . $q_item['url'] . '">' . $q_item['title'] . '</a>',

0 commit comments

Comments
 (0)