Skip to content

Commit 1719579

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 4344721 commit 1719579

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
@@ -774,7 +774,7 @@ public function page_title_error()
774774
if (isset($favorite))
775775
$this->output('<form ' . $favorite['form_tags'] . '>');
776776

777-
$this->output('<div class="qa-main-heading">');
777+
$this->output('<div class="qa-main-heading" dir="auto">');
778778
$this->favorite();
779779
$this->output('<h1>');
780780
$this->title();
@@ -1753,7 +1753,7 @@ public function q_item_clear()
17531753
public function q_item_title($q_item)
17541754
{
17551755
$this->output(
1756-
'<div class="qa-q-item-title">',
1756+
'<div class="qa-q-item-title" dir="auto">',
17571757
'<a href="' . $q_item['url'] . '">' . $q_item['title'] . '</a>',
17581758
// add closed note in title
17591759
empty($q_item['closed']['state']) ? '' : ' [' . $q_item['closed']['state'] . ']',
@@ -2238,7 +2238,7 @@ public function q_view_content($q_view)
22382238
{
22392239
$content = isset($q_view['content']) ? $q_view['content'] : '';
22402240

2241-
$this->output('<div class="qa-q-view-content qa-post-content">');
2241+
$this->output('<div class="qa-q-view-content qa-post-content" dir="auto">');
22422242
$this->output_raw($content);
22432243
$this->output('</div>');
22442244
}
@@ -2401,7 +2401,7 @@ public function a_item_content($a_item)
24012401
$a_item['content'] = '';
24022402
}
24032403

2404-
$this->output('<div class="qa-a-item-content qa-post-content">');
2404+
$this->output('<div class="qa-a-item-content qa-post-content" dir="auto">');
24052405
$this->output_raw($a_item['content']);
24062406
$this->output('</div>');
24072407
}

qa-theme/SnowFlat/qa-theme.php

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

347347
$this->output(
348-
'<div class="qa-q-item-title">',
348+
'<div class="qa-q-item-title" dir="auto">',
349349
// add closed note in title
350350
$imgHtml,
351351
'<a href="' . $q_item['url'] . '">' . $q_item['title'] . '</a>',

0 commit comments

Comments
 (0)