Repository: Khan/KaTeX
Pull request #1203 (2018-03-10 17:53:08)

Support Unicode °
Oddly, `unicode-math-table.txt` does not contain an entry for °, U+00B0. But `\degree` is surely the correct mapping.

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


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

```diff
@@            Coverage Diff             @@
##           master    #1203      +/-   ##
==========================================
+ Coverage   79.65%   79.66%   +<.01%     
==========================================
  Files          59       59              
  Lines        3883     3884       +1     
  Branches      654      654              
==========================================
+ Hits         3093     3094       +1     
  Misses        657      657              
  Partials      133      133
```


| [Impacted Files](https://codecov.io/gh/Khan/KaTeX/pull/1203?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/symbols.js](https://codecov.io/gh/Khan/KaTeX/pull/1203/diff?src=pr&el=tree#diff-c3JjL3N5bWJvbHMuanM=) | `100% <100%> (ø)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/Khan/KaTeX/pull/1203?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/1203?src=pr&el=footer). Last update [abfb641...c05991b](https://codecov.io/gh/Khan/KaTeX/pull/1203?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/src/symbols.js b/src/symbols.js
index 1700dc7a..dc93abe2 100644
--- a/src/symbols.js
+++ b/src/symbols.js
@@ -696,8 +696,11 @@ defineSymbol(text, main, textord, "\u201c", "``");
 defineSymbol(text, main, textord, "\u201c", "\\textquotedblleft");
 defineSymbol(text, main, textord, "\u201d", "''");
 defineSymbol(text, main, textord, "\u201d", "\\textquotedblright");
-defineSymbol(math, main, textord, "\u00b0", "\\degree");
+//  \degree from gensymb package
+defineSymbol(math, main, textord, "\u00b0", "\\degree", true);
 defineSymbol(text, main, textord, "\u00b0", "\\degree");
+// \textdegree from inputenc package
+defineSymbol(text, main, textord, "\u00b0", "\\textdegree", true);
 // TODO: In LaTeX, \pounds can generate a different character in text and math
 // mode, but among our fonts, only Main-Italic defines this character "163".
 defineSymbol(math, main, mathord, "\u00a3", "\\pounds");


Test patch:
diff --git a/test/katex-spec.js b/test/katex-spec.js
index b490c13b..d5214e62 100644
--- a/test/katex-spec.js
+++ b/test/katex-spec.js
@@ -2936,7 +2936,7 @@ describe("Unicode", function() {
     });
 
     it("should parse symbols", function() {
-        expect("£¥ðℂℍℑℓℕ℘ℙℚℜℝℤℲℵℶℷℸ⅁∀∁∂∃∇∞∠∡∢♠♡♢♣♭♮♯✓\u00b7").toParse();
+        expect("£¥ðℂℍℑℓℕ℘ℙℚℜℝℤℲℵℶℷℸ⅁∀∁∂∃∇∞∠∡∢♠♡♢♣♭♮♯✓°\u00b7").toParse();
     });
 
     it("should parse arrows", function() {