Skip to content

Commit

Permalink
fix(docs): display text direction correctly (freeCodeCamp#40345)
Browse files Browse the repository at this point in the history
  • Loading branch information
huyenltnguyen authored Nov 29, 2020
1 parent c143644 commit f1f6cf8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,20 @@

// Used from https://github.com/ckoliber/docsify-rtl/blob/master/build/docsify-rtl.js,
// Currently this is a hack because can't use the plugin as is.
if (vm.route.path.search('Arabic') !== -1) {
if (vm.route.path.search('Arabic') !== -1 || vm.route.path.search('Hebrew') !== -1) {
for (var counter = 0, elements = document.getElementsByClassName("markdown-section"); counter < elements.length; counter++) {
var item = elements[counter];
item.dir = "rtl";
}
};

if (vm.route.path.search('Arabic') === -1 && vm.route.path.search('Hebrew') === -1) {
for (var counter = 0, elements = document.getElementsByClassName("markdown-section"); counter < elements.length; counter++) {
var item = elements[counter];
item.dir = "ltr";
}
};

return (
markdown +
'\n----\n' +
Expand Down

0 comments on commit f1f6cf8

Please sign in to comment.