Skip to content

Commit

Permalink
missing use strict
Browse files Browse the repository at this point in the history
  • Loading branch information
dealfonso committed Sep 1, 2023
1 parent d6d4259 commit 6cadb8c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
8 changes: 5 additions & 3 deletions js/showsource.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
SOFTWARE.
*/

defaultOptions = {
'use strict';

let defaultOptions = {
// The indentation to be used (the spaces at the beginning of the line) (inheritable)
indentation: " ",
// Remove the children of these types of elements
Expand Down Expand Up @@ -109,7 +111,7 @@ function beautify(el, userOptions = {}, indent = "") {
if (typeof options.removeAttributes === "string") {
removeAttributes = options.removeAttributes.split(" ");
}
for (attribute of el.attributes) {
for (let attribute of el.attributes) {
if (attribute.name.startsWith("data-showsource")) {
if (options.hidePlugin) {
continue;
Expand Down Expand Up @@ -164,7 +166,7 @@ function beautify(el, userOptions = {}, indent = "") {
beautifulElement[beautifulElement.length - 1] += ">";
}
if (!options.skipChildren) {
for (child of el.childNodes) {
for (let child of el.childNodes) {
if (child.nodeType == Node.TEXT_NODE) {
let text = child.textContent.trim();
if (text !== "") {
Expand Down
7 changes: 4 additions & 3 deletions showsource.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
*/

(function(window, document) {
defaultOptions = {
"use strict";
let defaultOptions = {
indentation: " ",
remove: "h1 h2 h3 h4 h5 h6 p",
hide: false,
Expand Down Expand Up @@ -78,7 +79,7 @@
if (typeof options.removeAttributes === "string") {
removeAttributes = options.removeAttributes.split(" ");
}
for (attribute of el.attributes) {
for (let attribute of el.attributes) {
if (attribute.name.startsWith("data-showsource")) {
if (options.hidePlugin) {
continue;
Expand Down Expand Up @@ -126,7 +127,7 @@
beautifulElement[beautifulElement.length - 1] += ">";
}
if (!options.skipChildren) {
for (child of el.childNodes) {
for (let child of el.childNodes) {
if (child.nodeType == Node.TEXT_NODE) {
let text = child.textContent.trim();
if (text !== "") {
Expand Down
2 changes: 1 addition & 1 deletion showsource.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6cadb8c

Please sign in to comment.