Repository: Khan/KaTeX
Pull request #1459 (2018-07-01 01:28:35)

Support Unicode corners
In the KaTeX fonts, the `⌜` `⌝` `⌞` `⌟` characters, for the AMS functions `\ulcorner`, `\urcorner`, `\llcorner`, and `\lrcorner` respectively, are located at the Unicode code points for Box Drawings corners. In contrast, `unicode-math` maps those functions to Unicode code points U+231C - U+231F. The names of those code points are Top Left Corner, Top Right Corner, etc, in the Unicode Miscellaneous Technical block. `unicode-math` doesn't map the Box Drawing corners to anything at all.

This PR adds support for U+231C through U+231F.

codecov[bot]: # [Codecov](https://codecov.io/gh/Khan/KaTeX/pull/1459?src=pr&el=h1) Report
> Merging [#1459](https://codecov.io/gh/Khan/KaTeX/pull/1459?src=pr&el=desc) into [master](https://codecov.io/gh/Khan/KaTeX/commit/c599c613f0fcfb6fe28187957df9e7971f240d2f?src=pr&el=desc) will **increase** coverage by `0.01%`.
> The diff coverage is `100%`.


[![Impacted file tree graph](https://codecov.io/gh/Khan/KaTeX/pull/1459/graphs/tree.svg?height=150&width=650&src=pr&token=vfDnj2P77o)](https://codecov.io/gh/Khan/KaTeX/pull/1459?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master    #1459      +/-   ##
==========================================
+ Coverage   83.22%   83.24%   +0.01%     
==========================================
  Files          77       77              
  Lines        4424     4428       +4     
  Branches      773      773              
==========================================
+ Hits         3682     3686       +4     
  Misses        642      642              
  Partials      100      100
```


| [Impacted Files](https://codecov.io/gh/Khan/KaTeX/pull/1459?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/macros.js](https://codecov.io/gh/Khan/KaTeX/pull/1459/diff?src=pr&el=tree#diff-c3JjL21hY3Jvcy5qcw==) | `89.28% <100%> (+0.17%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/Khan/KaTeX/pull/1459?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/Khan/KaTeX/pull/1459?src=pr&el=footer). Last update [c599c61...8864f07](https://codecov.io/gh/Khan/KaTeX/pull/1459?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

ronkok: @ylemkimon Good point. Fixed now. Thanks!

Patch:
diff --git a/src/macros.js b/src/macros.js
index c0e0d313..9c663967 100644
--- a/src/macros.js
+++ b/src/macros.js
@@ -320,6 +320,10 @@ defineMacro("\u225F", "\\stackrel{\\tiny?}{=}");
 defineMacro("\u27C2", "\\perp");
 defineMacro("\u203C", "\\mathclose{!\\mkern-0.8mu!}");
 defineMacro("\u220C", "\\notni");
+defineMacro("\u231C", "\\ulcorner");
+defineMacro("\u231D", "\\urcorner");
+defineMacro("\u231E", "\\llcorner");
+defineMacro("\u231F", "\\lrcorner");
 
 //////////////////////////////////////////////////////////////////////
 // LaTeX_2ε


Test patch:
diff --git a/test/katex-spec.js b/test/katex-spec.js
index 8071f03f..0db175bb 100644
--- a/test/katex-spec.js
+++ b/test/katex-spec.js
@@ -3064,6 +3064,7 @@ describe("Unicode", function() {
         expect("\\left\u27e8\\frac{a}{b}\\right\u27e9").toBuild();
         expect("\\left\u23b0\\frac{a}{b}\\right\u23b1").toBuild();
         expect("┌x┐ └x┘").toBuild();
+        expect("\u231Cx\u231D \u231Ex\u231F").toBuild();
     });
 
     it("should build some surrogate pairs", function() {