code 삽입을 위한 highlight.js 적용
1) https://highlightjs.org/#as-html-tags 참고
2) Blogger의 '테마 HTML 편집창' 선택
3) </head> 위에 아래 코드 삽입후 저장
<!--code block highligh.js Start-->
<link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/base16/google-dark.min.css" rel="stylesheet"></link>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js">
<script>hljs.highlightAll();</script>
<!--code block highligh.js End.-->
4) '<> HTML View' 모드에서 본문에 삽입할 코드를 아래 형식으로 입력.
<pre><code class="language-javascript"> ...... </code></pre>5) 예제
const array1 = [1, 2, 3, 4];
// 0 + 1 + 2 + 3 + 4
const initialValue = 0;
const sumWithInitial = array1.reduce(
(accumulator, currentValue) => accumulator + currentValue,
initialValue,
);
console.log(sumWithInitial);
// Expected output: 106) 'Raw HTML'을 'Escaped HTML'로 변환은 https://accessify.com/ 참고



Comments
Post a Comment