markdown - Github 和 npm table markdown 的区别
问题描述
我的readme.md
Markdown 表在 npm 上正确显示,但在 GitHub 上却没有。
这是表格降价:
Attributes | Field type | value | description
- | - | - | -
required | `*` | boolean`(default=false)` | check if field has a value if set true.
requiredPhrase | `*` | string`(default=This field is required.)` | error shown when field is required and empty.
name | `*` | string | a unique string in form, on submitting the form you can access a field value by values.`<name>`
placeholder | `*` | string`(default=null)` | inputs placeholder.
defaultValue | `*` | any`(default=null)` | in case of editing forms pass current values via `defaultValue`.
maxLength | `text`, `number` and `password` | number`(default=null)` | maximum value length.
maxLengthErrorPhrase | `text`, `number` and `password` | string`(default=This field accepts <maxLength> characters.)` | error shown when maxLength is crossed.
multiSelect | `select`| boolean`(default=false)` | set true if select can have more than one values.
selectHandle | `select` | component`(default=an ungly css-made triangle)`, example: `<i className="ion-ios-arrow-down` (which needs ionicons) | this option is for changing the select box handle component.
options | `select`, `radio` | array of objects with `label` and `value` | choices for select input and radio group.
checkboxLabel| `checkbox` | string`(default:'')`| checkbox label.
mustBeCheckedPhrase| `checkbox` | string`(default:'This field must be checked.')`| error shown when checkbox is required and not checked.
也许 GitHub 使用不同的 Markdown?
npm 链接:https ://www.npmjs.com/package/reformact#field-attributes
GitHub 链接:https ://github.com/kiarashws/reformact#field-attributes
解决方案
要么添加一个领先的管道:
| Attributes | Field type | value | description
| - | - | - | -
| required | `*` | boolean`(default=false)` | check if field has a value if set true.
| requiredPhrase | `*` | string`(default=This field is required.)` | error shown when field is required and empty.
或使用两个(或多个)连字符而不是一个,这样它们就不会被解析为项目符号:
Attributes | Field type | value | description
-- | -- | -- | --
required | `*` | boolean`(default=false)` | check if field has a value if set true.
requiredPhrase | `*` | string`(default=This field is required.)` | error shown when field is required and empty.
我还建议去掉锯齿状的前导空格,以提高原始 Markdown 的可读性。
推荐阅读
- r - 是否可以通过 RPostgresql 运行 Postgres 反斜杠命令?
- c# - 为什么我的查询字符串参数被 url 解码两次?
- php - Web Scraper - PHP - 简单的 html dom
- javascript - 节点作为强制布局中的列表(在地图上)
- git - 有没有办法在 Git 中不使用 Commit 或 Stash 来保存我当前的更改?
- javascript - 根据 iframe 内容向父页面中的元素添加类
- typescript - Angular 6 with Angular Google Maps (AGM) - 如何获取所有可见标记?
- angular - 在 Angular 6 中写入文件
- javascript - 单击按钮时如何将滚动条向下移动到页面的特定坐标
- html - 如何将图片平行于