Files
FixIt/apps/test/content/posts/codeblock-test.md
T
2025-11-28 16:53:42 +08:00

2.1 KiB

title, date, collections, categories, tags
title date collections categories tags
Code Block Test 2025-11-28T15:16:35+08:00
Tests
Markdown
Code Block

Testing code block in FixIt theme.

🎉🥚 in development mode!

Diff Code

- theme = "LoveIt"
+ theme = "FixIt"
! enhancements and fixes

Long Code

<p>Lorem ipsum dolor sit amet, graecis denique ei vel, at duo primis mandamus. Et legere ocurreret pri, animal tacimates complectitur ad cum. Cu eum inermis inimicus efficiendi. Labore officiis his ex, soluta officiis concludaturque ei qui, vide sensibus vim ad.</p>
<p>Lorem ipsum dolor sit amet, graecis denique ei vel, at duo primis mandamus. Et legere ocurreret pri, animal tacimates complectitur ad cum. Cu eum inermis inimicus efficiendi. Labore officiis his ex, soluta officiis concludaturque ei qui, vide sensibus vim ad.</p>

Highlighting

Highlighting in code fences is enabled by default.

287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 /** * check if a string is a JS object string * @example isObjectLiteral("{a:1,b:2}") // true * @param {string} str string to check * @returns {boolean} whether the string is a JS object string */ function isObjectLiteral(str) { if (typeof str !== 'string') { return false } str = str.replace(/\s+/g, ' ').trim().replace(/;$/, '') if (str.startsWith('{') && str.endsWith('}')) { return true } return false }

Highlighting in shortcode highlight.

{{< highlight javascript "linenos=table,hl_lines=2 8-10,linenostart=287" >}} /**

  • check if a string is a JS object string
  • @example isObjectLiteral("{a:1,b:2}") // true
  • @param {string} str string to check
  • @returns {boolean} whether the string is a JS object string */ function isObjectLiteral(str) { if (typeof str !== 'string') { return false } str = str.replace(/\s+/g, ' ').trim().replace(/;$/, '') if (str.startsWith('{') && str.endsWith('}')) { return true } return false } {{< /highlight >}}

Gist Embed

{{< gist Lruihao fb8b2d0353465c4d40bf74818db80710 >}}