Commit Graph

8 Commits (master)

Author SHA1 Message Date
Ika 4af3dd4b07
test: improve snapshots (#5521)
- before
  ```
  ${input}${"~".repeat(printWidth)}
  ${output}
  ```
- after
  ```
  ===options===
  ${options}
  ${" ".repeat(printWidth)}| printWidth
  ====input====
  ${input}
  ===output====
  ${output}
  =============
  ```
2018-11-25 16:21:14 +08:00
Huáng Jùnliàng d86f39cb83 fix(markdown): add more category to CJK regex (#5480)
The following characters should be treated as CJK character

```
3099..309A    ; Hira Kana # Mn   [2] COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK..COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
309B..309C    ; Hira Kana # Sk   [2] KATAKANA-HIRAGANA VOICED SOUND MARK..KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
```

Here is the [playground link](https://deploy-preview-5402--prettier.netlify.com/playground/#N4Igxg9gdgLgprEAuEhqhkFkMhahnYeoZ2EaGdQZoZ1AzBkEyGVczcnco8gHSmcGkGQEwZTB7BkHuGQGQjAdgw9AgAyAHhmGBHhmGAnhkDWDIEH7QJ0OgJIZAG3KB1BlIACANoA3ALpbAz+nLAFhGA-50CaDIGiGQMoMgCwZAEP89A2Qxj3E99NeBIf8BBDHyA8QyAMQyA+gyAMgzCgABygDRBgCFuslyAVgyAkQzJrIDGDGGAQAzMzCAANCAQAA4wAJbQAM7IoACGAE6NEADuAApNCLUo9XoQFQAmRSAARo31YADWcDAAyqWTFVAA5sgwjQCucMUAFjAAtgA2AOq7FfDVi2Bwc90XFXoXAJ7I4NW1xcvVcI0w7RMVgd6sgAGb1I4-YoAK2qAA8AEITaazOb1A5wAAyyzgYIhUJAsLhc2WKyOcAAipsIPA8ZCdiBFo0fo03sDGlNBm0oCNSi0ficJqU3ny4Cy9Ljio04ABHTYVaUA+pAkFIcH04o-A4VdZbBnVUnkqk03Fq-EMmD1UYnIYwXbIABMxQ29QqR1JAGEIAdgW8oNBJSBNj8ACpWnrqgl85YwG2DO3IADsAAYAL6poA) to show that current `prettier` adds redundant whitespaces around the characters.

The testcase text are copied from [半濁点 - Wikipedia](https://ja.wikipedia.org/wiki/%E5%8D%8A%E6%BF%81%E7%82%B9) and [ヴ - Wikipedia](https://ja.wikipedia.org/wiki/%E3%83%B4) respectively.
2018-11-15 00:10:50 +08:00
Ika 4e7fca5047
fix(markdown): identify CJK correctly (#5402) 2018-11-10 01:00:58 +08:00
Ika 91206891cd
fix(markdown): do not add whitespaces between Latin and Hangul (#5040)
Based on https://github.com/prettier/prettier/issues/5028#issuecomment-417825085, it seems Korean text uses conventional space so we're not going to add whitespaces between Latin and Hangul.
2018-09-02 16:20:22 +08:00
Simen Bekkhus 51b7c02e12 Upgrade jest to 22 (#4782)
* chore: upgrade Jest

* chore: update snapshots

* chore: lock down babel dependency using invalid syntax

* 2 args to test.skip

* use jest 22 for now

* Revert "2 args to test.skip"

This reverts commit 691fdc3f99e320f2303958f2b503f7b4c93fa455.

* remove snapshot name from matcher

* fix standalone tests skips
2018-07-03 03:06:29 -03:00
Ika 073c0b16d8 feat(markdown): add `proseWrap: "preserve"` option (#3340)
* test: add test case

* feat(markdown): add `proseWrap: "preserve"` option

* test: add tests

* docs(options): update `proseWrap`

* feat(markdown): change default to `proseWrap: "preserve"`

BREAKING CHANGE

* docs(options): update `proseWrap`

* test: specify option explicitly

* Fix lint after merge

* Fix error after merge
2017-12-02 09:48:40 +11:00
Lucas Duailibe f119d4a90f
Change run_spec to have explicit parser list (#3356) 2017-11-30 03:31:52 -03:00
Ika c27cc7ff45 feat(markdown): support CJK and emoji (#3026)
* refactor: extract `splitText`

* fix: respcet CJK width in table

* test: add failing test

* fix: support emoji

* test: add failing test

* feat: support CJK character

* feat: enable adding whitespace between non-CJK/CJK-character by default

* fix: do not print softline at node that is sensitive to its identifier

* fix: treat full-width whitespace as CJK punctuation

* disallow leading/trailing full-width whitespace

* feat: remove `--split-cjk-text` option and enable it by default

* refactor: simplify regex and remove unnecessary `g` flag
2017-10-14 23:57:31 -05:00