Giter Site home page Giter Site logo

markdown-formatter's People

Contributors

sumnow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

markdown-formatter's Issues

bad formatting for dots

HI!
Thanks for this nice add-on.
Everything is great except this sentence:
in certain situations: Logging in, calling apis, etc ... . For this to work you can
on format turns to this:
in certain situations: Logging in, calling apis, etc .... For this to work you can

But there is a difference. I want that space on my dots.

引用下的表格

  • 格式化之前
    image
  • 格式化之后
    image
    把第一列的<也当成表格的一部分

Formatter converts style of unordered lists

When I create an unordered list I do it like this

* foo
  * bar
    * baz
  * quux

The formatter converts this to

* foo
  + bar
    - baz
  + quux

But this is caught by the markdown linter

MD004/ul-style: Unordered list style [Expected: asterisk; Actual: dash]markdownlint(MD004)

Is there a way to make the formatter not change the asterisks?

yaml code blocks get formatted

Due to its syntax similar to markdown, yaml code blocks are formatted as if there are markdown lines, even though if have "markdownFormatter.formatCodes": false in my settings.json.

So the following file:

a:
  - b
  - c:
    - d 

```yaml
a:
  - b
  - c:
    - d 
```
  
```python
a:
  - b
  - c:
    - d 
```

will be wrongly formatted as follows:

a:

  + b
  + c:
    - d

``` yaml
a:

  + b
  + c:
    - d

```

``` python
a:

  + b
  + c:
    - d

```

table格式bug

tableBug

表格中含有|的字符会默认识别为制表符。(可以考虑排除`包裹的|`和\|(转义后的|))

tableBug1

错误地加转义符号 \

image

一格式化就给我有些地方的符号加转义符,不知道为啥?
难道是我 markdown 语法哪里不规范?

列表接着一级标题格式化出错

  • 描述
    • 我在写一个列表之后跟着一个一级标题
    • 例如
      • 1.a
      • 2.b
        然后空一行 跟着一个一级标题 # 标题
        格式化就会变成 2.b# 标题
        就是标题哪一行和列表最后一行接在一起了

Ability to configure list numbers and symbols

Thanks for this cool extension 👍

I'd like to suggest adding the ability to config list numbers and symbols.

For instance:

  • defining - as the only list symbol.
  • defining 1. as the only numbered list symbol.

It's always a pain to see lists like:

1. a
2. b
3. c

When markdown supports the following which helps when you need to reorganize steps 👍

1. a
1. b
1. c

Markdown files do not get formatted

Steps to reproduce

Invoke the Format Document command on a Markdown file.

Expected behavior

The file should get formatted.

Actual behavior

The file does not get formatted; instead, VSCode displays a notification that There is no formatter for 'markdown' files installed., even though I already have the markdown-formatter extension installed.

Version 0.7.5 of the extension used to work properly but as of 0.7.6, the aforementioned notification appears for every Markdown file which I try to format.

格式化操作会破坏原有链接

示例文本:

* <https://onedrive.live.com/redir?resid=F3A8A31ABFAC51B0!256&authkey=!AC4-yOEjn0bgrCQ&ithint=file%2crar>

* 下载: Please download from [OneDrive](https://1drv.ms/u/s!ApwdOxIIFBH19TzDv7nRfH5ZsMNL) or [Baiduyun](http://pan.baidu.com/s/1bQ4yHC).

格式化之后

可以看到,在某些感叹号之后断开了。

希望能增加自定义不全功能和侧边栏目录功能

  1. 现有的插入代码块功能挺好用的,如果能实现自定义补全就更好了
  2. 有时候写的markdown文档很长,如果要去找某个章节就得回到初始位置用过toc目录去访问,要是能在markdown编辑页面实现Markdown Preview Enhanced插件那个侧边目录就好了,当然这个功能可能不在这个插件的考虑范围内

格式化序号有bug

格式化前:
image

格式化后:
image

只有这段出现了该情况,其他的列表都正常工作了。

还有可否出个配置项来关闭序号补零这个功能。

格式化md里面的代码时,有bug

比如下面的代码

$ npm install miniprogram-to-uniapp - g

放在md里面进行格式化时,,好家伙,变成这样的~~

$ npm install miniprogram - to - uniapp - g

我。。。。

有关snippet的一点建议

我发现作者你写的不少snippet和vscode自带的重复了, 并没有必要重写(实际使用的时候两个还会有点分不清):
image
能不能提供一个选项关闭插件带的snippet?同时在readme里列出一些snippet, 需要的自行添加进用户的snippet即可
这里找到了一种隐藏的方式, 但是依旧比较麻烦microsoft/vscode#10565 (comment)
我现在的做法是直接修改扩展文件里的markdown.json删除我不需要的snippet, 但是更新后肯定需要重来... 开发者有什么建议吗?

table 格式化错误

您好, 我在格式化表格时, 其格式会出错,比如下面的情况

image

会被格式化为

image

谢谢作者解决一下

将配置里的全角符号转化为半角符号

// 将配置里的全角符号转化为半角符号, 例如 `,:;!“”‘’()?。` , 当设置为false的时候, 自动根据上下文转换符号
charactersTurnHalf = config.get<any>('charactersTurnHalf', false); 

这个要如何设置, 我设置为:

"markdownFormatter.charactersTurnHalf": {"charactersTurnHalf": true}

报错: charactersTurnHalf.split is not a function

Formatting issue in shell/bash code block

Hello,

See this example:

Assign command output to a variable

#!/bin/bash 
SERVER_NAME=`hostname`
echo "You are running this script on ${SERVER_NAME}." 

# Output: You are running this script on linuxsvr. 

After format, it adds a space after the "=" like this:

SERVER_NAME= `hostname`

And this is invalid in shell/bash.

Could you stop this behaviour for bash codeblock pls?

Thanks for your extension.

Regards,
Tif

“扩展markdown-formatter无法格式化文档”

对于我当前的配置:

    // markdown-formatter conf
    "markdownFormatter.codeAreaToBlock": "",
    // 自动格式化标点
    // "markdownFormatter.fullWidthTurnHalfWidth": "auto",
    // 中文标点格式化为英文
    "markdownFormatter.fullWidthTurnHalfWidth": ",:;!“”‘’()?。",
    "markdownFormatter.formatOpt": {
        "indent_size": 2
    },
    "[markdown]": {
        // 自动保存
        "editor.formatOnSave": true,
        // 显示空格
        "editor.renderWhitespace": "all",
        // 快速补全
        "editor.quickSuggestions": {
            "other": true,
            "comments": true,
            "strings": true
        },
        // snippet 提示优先
        "editor.snippetSuggestions": "top",
        "editor.tabCompletion": "on",
        // 使用enter 接受提示
        "editor.acceptSuggestionOnEnter": "on",
        "editor.defaultFormatter": "mervin.markdown-formatter"
    }

插件信息:

image

vscode版本信息:

版本: 1.40.1
提交: 8795a9889db74563ddd43eb0a897a2384129a619
日期: 2019-11-13T16:49:30.162Z
Electron: 6.1.2
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Linux x64 5.0.0-23-generic

无法格式化文档,会提示如下信息:

image

关于嵌套的连接的格式化问题

格式化之后是这样的:
image
但我本身是这样的:

[![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)

关于部分标点符号的替换的小问题

关于部分标点符号的替换的小问题

如果原始的中文符号句号后有两个空格, 转换后会导致符号后面有两个空格, 可否始终保持一个空格?

原文:

一个空格, 两个空格,  一个空格。 两个空格。  补充文字。
一个空格,两个空格,一个空格。两个空格。补充文字。

格式化之后:

一个空格, 两个空格, 一个空格. 两个空格.  补充文字.
一个空格, 两个空格, 一个空格. 两个空格. 补充文字.

另外对于顿号的格式化问题,英文没有顿号,如果替换,是否可以替换为逗号。或者您可以考虑使用半角逗号。

原文:

阿双方就大家、阿里山的房间了,按时到廊坊……。

格式化之后(顿号后面还多了一个空格):

阿双方就大家、 阿里山的房间了, 按时到廊坊…….

how format code block in markdown

image
image

As shown in the figure, I have configured codeAreaToBlock, but how do I operate to make code block formatting? For example, add a indent?

I try shorcode,but do not have effect. And enter key also!

半角符号不能转换

    // markdown-formatter conf
    "markdownFormatter.fullWidthTurnHalfWidth": ",:;!“”‘’()?。",
    "markdownFormatter.formatULSymbol": true,
    "markdownFormatter.spaceAfterFullWidth": true,
    "markdownFormatter.formatOpt": {
        "indent_size": 4
    },
    "[markdown]": {
        "editor.defaultFormatter": "mervin.markdown-formatter"
    },

我发现对于英语文字后面的全角标点并不能转化呀。。。

tableBug

tableBug2

当table的制表符(标题下的那行)完整时,格式化无效。

tableBug3

这样的内容无法格式化

It's not formatting properly lines that contain regexp

I have a markdown files with some regexp and when i format, it does the following behaviour:
Before formatting:

# Regexp
## Regex A
`^(.*myPattern.*)$`
## Regex B
`([^\/]+)$`

After formatting:

# Regexp
## Regex A
`^(.*myPattern.*)# Regexp
## Regex B
`([^\/]+)# Regexp

It seems to be removing some characters and appending the Heading 1.

You can test it, just open a .md file paste that and then format.
Congratulations for your extension, i found it very useful.

怎么关闭这个默认+空格的功能

image
如上图,img src里面的 . 格式化的时候默认被加入了空格,图片就展示不出来. 还有域名也会被加入空格,我想关闭这个,还是说我直接把格式化的功能给关闭比较好

linux 上格式化makrdown表格不管用,没有自动添加空格

这是我的配置
"markdownFormatter.codeAreaToBlock": "", "markdownFormatter.fullWidthTurnHalfWidth": "auto", "markdownFormatter.formatOpt": { "indent_size": 2 }, "[markdown]": { "editor.formatOnSave": true, "editor.renderWhitespace": "all", "editor.quickSuggestions": { "other": true, "comments": true, "strings": true }, "editor.snippetSuggestions": "top", "editor.tabCompletion": "on", "editor.acceptSuggestionOnEnter": "on", "editor.defaultFormatter": "mervin.markdown-formatter" }

How to disable formatter with a file

Because of a unexcepted result with formatter, I need to disable formatter in serveral files.

what I write:

- list1

    ``` js
    console.log(1)
    ```

- list 2

I set auto format on save, so I press cmd+s, first time, it changes to be below

* list1

    

\``` js
    console.log(1)
\```

* list 2

and save again:

* list1

\``` js
    console.log(1)
\```

* list 2

I add \ at line start, I don't know how to write nest ``` in codeblock : (

it finally formatting done. but not I want. as image shows

image

So, I need to disable formatter with files, maybe need something like ignorePath, or support a 'disable' comment in file.

Of course this might be a bug, if can be fixed will be better

2 blank lines added at the end of file, conflicts with markdownlint

Hi!

The extension adds 2 new lines at the end of the file, which conflicts with linting rules. Is there a setting to suppress that?

I added these rules, but they do not make a difference:

   "markdownFormatter.formatOpt": {
      "end-with-newline": false,
      "indent_size": 2,
      "preserve-newlines": false,
      "max-preserve-newlines": 1
    },

(When I disable the markdown-formatter extension, no empty lines are added, so I assume it is something that this extension does and not VScode...)

Thank you!

Spaces being added forever between comma and snippet

  1. Create a markdown file
  2. Create a bullet point, followed by a comma and a code snippet
  3. e.g.:
* word,`code`
  1. Run format code
  2. The formatted will repeatably insert more and more spaces between the comma and start of the snippet eg:
* word,               `code`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.