Open adhuliya opened 6 years ago
Markdown files with other than default name fails to load using the global variable file declared in the <head> element:
file
<head>
<script> var file = "other.md"; </script>
When the following line in render.js tests the condition,
render.js
var file = file || "README.md";
the first access to the file object is always undefined (due to hoisting), hence README.md is chosen by default.
undefined
README.md
Changing the above line to:
var file = this.file || "README.md";
solves the issue for me. (Notice the use of this)
this
Markdown files with other than default name fails to load using the global variable
file
declared in the<head>
element:When the following line in
render.js
tests the condition,the first access to the
file
object is alwaysundefined
(due to hoisting), henceREADME.md
is chosen by default.Changing the above line to:
solves the issue for me. (Notice the use of
this
)