diff --git a/blocks/dave/dave.css b/blocks/dave/dave.css new file mode 100644 index 0000000..f3a193f --- /dev/null +++ b/blocks/dave/dave.css @@ -0,0 +1,12 @@ +.dave strong { + color: green; + font-size: 2rem; + font-weight: bold; + border-bottom: 2px solid green; +} + +.dave i { + color: red; + font-size: 1.5rem; + font-style: italic; +} \ No newline at end of file diff --git a/blocks/dave/dave.js b/blocks/dave/dave.js new file mode 100644 index 0000000..8ca2668 --- /dev/null +++ b/blocks/dave/dave.js @@ -0,0 +1,13 @@ +export default function decorate(block) { + const quoteDiv = block.querySelector('div:last-of-type'); + const dave = document.createElement('dave'); + dave.innerHTML = `${quoteDiv.innerHTML}`; + quoteDiv.replaceWith(dave); + + const authorDiv = block.querySelector('div:nth-child(2)'); + if (authorDiv) { + const author = document.createElement('p'); + author.innerHTML = `${authorDiv.innerHTML}`; + authorDiv.replaceWith(author); + } +}