commit c095659afe925c669cd841c7ac3e61b9bb37f92e
parent 5a0f447cc63e465c719b59f461ee7f2db3df4aba
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date: Mon, 2 Dec 2019 20:05:23 -0500
Correct code example
Diffstat:
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/content/posts/2019-12-01-fun-with-fonts-on-the-web.en.md b/content/posts/2019-12-01-fun-with-fonts-on-the-web.en.md
@@ -12,9 +12,9 @@ A more accurate version of the title probably should be "Fun with Fonts in Web B
Most browsers join consecutive lines of text in HTML to a single one with an added space in between, so
-```text
-Line one and
-line two.
+```html
+<html>Line one and
+line two.</html>
```
renders to
@@ -27,7 +27,7 @@ Such a simplistic rule doesn't work for CJK languages where no separators is use
```html
<html lang="zh">第一行和
-第二行。<html>
+第二行。</html>
```
If your browser is smart enough (like Firefox), it will join the lines correctly. All the Blink based browsers, however, still stubbornly shove in the extra space, so it looks like I will be stuck in unwrapped source files like a barbarian for a bit longer. While not a cure-all solution, specifying the `lang` attribute still have the added benefit of enabling language-specific CSS rules, which comes in handy later.
diff --git a/org/2019.org b/org/2019.org
@@ -356,10 +356,10 @@ A more accurate version of the title probably should be "Fun with Fonts in Web B
*** SPAAAAACE!
Most browsers join consecutive lines of text in HTML to a single one with an added space in between, so
-#+BEGIN_EXAMPLE
-Line one and
-line two.
-#+END_EXAMPLE
+#+BEGIN_SRC html
+ <html>Line one and
+ line two.</html>
+#+END_SRC
renders to
#+BEGIN_EXAMPLE
Line one and line two.
@@ -368,7 +368,7 @@ Line one and line two.
Such a simplistic rule doesn't work for CJK languages where no separators is used between words. The solution is to specify the =lang= attribute for the page (or any specific element on the page) like so:
#+BEGIN_SRC html
<html lang="zh">第一行和
- 第二行。<html>
+ 第二行。</html>
#+END_SRC
If your browser is smart enough (like Firefox), it will join the lines correctly. All the Blink based browsers, however, still stubbornly shove in the extra space, so it looks like I will be stuck in unwrapped source files like a barbarian for a bit longer. While not a cure-all solution, specifying the =lang= attribute still have the added benefit of enabling language-specific CSS rules, which comes in handy later.