Skip to content

Commit e29e557

Browse files
setup baseline format output for rich text and html
1 parent 9d9241d commit e29e557

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ <h3>Website</h3>
352352

353353
<article>
354354
<h4>Rich Text</h4>
355-
<p>[contextually formatted mark here]</p>
355+
<p class="rich-text mark">[contextually formatted mark here]</p>
356356

357357
<footer>
358358
<div>
@@ -365,7 +365,7 @@ <h4>Rich Text</h4>
365365

366366
<article>
367367
<h4>HTML</h4>
368-
<p>[contextually formatted mark here]</p>
368+
<p class="html mark">[contextually formatted mark here]</p>
369369

370370
<footer>
371371
<div>

src/scripts.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,24 @@ function renderMarkingFormats(state) {
285285
console.log(templateContent);
286286
}
287287

288+
// set contents of plain text mark
289+
// TODO: reverse use of <template> since it has limits on tokenization capacity, even if
290+
// it allows more dev readability.
288291
document.querySelector('#mark-your-work .plain-text.mark').appendChild(templateContent);
289292

290293

291294
//templateContent.textContent = parseTokens("year", attribution.workCreationYear, templateContent.textContent);
292295
//document.querySelector('#mark-your-work .plain-text.mark').appendChild(templateContent);
296+
297+
298+
// set contents of rich text mark
299+
let richTextMark = attribution.title + ' © ' + attribution.workCreationYear + ' by ' + attribution.creator + ' is ' + typeAsVerb + ' ' + '<a href="#">' + state.props.toolShort + '</a> <svg><use href="vocabulary/svg/cc/icons/cc-icons.svg#cc-logo"></use></svg> <svg><use href="vocabulary/svg/cc/icons/cc-icons.svg#cc-by"></use></svg> <svg><use href="vocabulary/svg/cc/icons/cc-icons.svg#cc-sa"></use></svg> ';
300+
document.querySelector('#mark-your-work .rich-text.mark').innerHTML = richTextMark;
301+
302+
303+
// set contents of HTML mark
304+
let htmlMark = '<textarea readonly="true">' + attribution.title + '</textarea>';
305+
document.querySelector('#mark-your-work .html.mark').innerHTML = htmlMark;
293306
}
294307

295308

0 commit comments

Comments
 (0)