Skip to content

Commit

Permalink
HTML validation: fix error 'Attribute data not allowed'
Browse files Browse the repository at this point in the history
  • Loading branch information
deining committed Apr 10, 2023
1 parent 311e45e commit 1706be2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions assets/js/shortcodes/intro.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ const themeCommonOptions = {
disableInteraction: true,
};
const introErrorTitle = atou(
document.getElementById('intro-error-title').getAttribute('data')
document.getElementById('intro-error-title').getAttribute('data-intro')
);
const introError = atou(
document.getElementById('intro-error').getAttribute('data')
document.getElementById('intro-error').getAttribute('data-intro')
);
const introEmpty = atou(
document.getElementById('intro-empty').getAttribute('data')
document.getElementById('intro-empty').getAttribute('data-intro')
);
const introErrorStep = {
showBullets: false,
Expand All @@ -90,7 +90,7 @@ for (let i = 0; i < divi.length; i++) {
divi[i].addEventListener('click', function () {
disableSmoothScroll();
let introOptions = parseIntroOptions(
atou(divi[i].getAttribute('intro-data'))
atou(divi[i].getAttribute('data-intro'))
);
introOptions.steps = manageTriggeredSteps(
introOptions.steps,
Expand Down
8 changes: 4 additions & 4 deletions layouts/shortcodes/intro.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@
{{- if eq ($.Page.Scratch.Get "introUid") 1 -}}
<div
id="intro-error-title"
data="{{- i18n "intro_error_title" | safeJS | base64Encode -}}"
data-intro="{{- i18n "intro_error_title" | safeJS | base64Encode -}}"
class="is-hidden"
></div>
<div
id="intro-error"
data="{{- i18n "intro_error" | safeJS | base64Encode -}}"
data-intro="{{- i18n "intro_error" | safeJS | base64Encode -}}"
class="is-hidden"
></div>
<div
id="intro-empty"
data="{{- i18n "intro_empty" | safeJS | base64Encode -}}"
data-intro="{{- i18n "intro_empty" | safeJS | base64Encode -}}"
class="is-hidden"
></div>
{{- end -}}
<div
class="sc-intro"
id="{{- $.Scratch.Get "introId" -}}"
intro-data="{{- . | safeJS | base64Encode -}}"
data-intro="{{- . | safeJS | base64Encode -}}"
>
{{- $.Scratch.Get "introtitle" -}}
</div>
Expand Down

0 comments on commit 1706be2

Please sign in to comment.