Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

Refactor and many many fixes #92

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

mcornella
Copy link

@mcornella mcornella commented Sep 23, 2020

This PR introduces the following:

  1. Refresh VSC extension development environment (basically make it as if the extension was just generated via the yeoman code extension generator).

    • Add eslint (introduces the lint npm script)
    • Update .vscode settings
    • Substitute vscode for @types/vscode and vscode-test packages (vscode is deprecated and doesn't contain all the typings)
    • Update package.json scripts
    • Update tsconfig and remove typings folder (compiles to es6)
    • Update vsc-extension-quickstart document (really not needed, I could remove it)
  2. Fix TypeScript errors and linting warnings
    Some of these fix a reliance on null coercing to undefined, others are making sure the TS compiler knows that window.activeTextEditor is always defined.

  3. Use line ending and tab settings of the file currently open. For this to be available I had to update the VS Code typings (commit 1).
    This is a better solution than Add check for Files>EOL ==="auto" and set it to "\n" #72 and Use OS EOL if lineEnding is set to auto #80

    Fixes markdownlint shows warning on 4-space indent of subsections (expects 2 spaces) #57, fixes Indentation Issue - MD007/ul-indent #60, fixes "auto" inserted instead of line breaks in TOC #65, fixes VSCODE markdown TOC问题咨询 #67, fixes broken when upgrade to latest vs code #68, fixes can not generate what i want,it has more auto #82, fixes Not working on Linux #90, fixes Inserts extra words "auto" and formats incorrectly #91.
    Closes Add check for Files>EOL ==="auto" and set it to "\n" #72, closes Use OS EOL if lineEnding is set to auto #80.

  4. Replace bold and italic marks but only if on start or end of a word. This fixes wrong removal of _ in headers introduced in fe9b778, which made headings like word_and_another_word be words all mushed together.
    Fixes [BUG] Anchors may have invalid chars that break the links #30, fixes [Bug] remove special characters on gitlab anchor mode #39.
    This fix should be upstreamed to anchor-markdown-header, which should only remove these marks in the anchor, not the link text.

  5. Simplify optionsFlag property operations
    Instead of using an array, it now uses an object so the test for flags is simpler (no .indexOf).

  6. Don't match ignore:true comments as the start of the TOC.
    Fixes Suggestion: a way to ignore certain headings #26 (comment).

  7. Remove decodeURI call which breaks on headings containing %
    Fixes Generate/update TOC doesn't respond #35, fixes Hope Chinese character will be percent encoded. #49, fixes Bug--如果标题含有%符号 则无法插入或者更新序号 #79.

  8. Track repeated links using the anchor (#title) instead of the title (title).
    Fixes Same headers with different cases don't generate unique links #93.

I know this is a big change but it can be more easily reviewed commit by commit and with whitespace changes turned off.

Other (issues maintenance)

Closes #26: fixes bug described in #26 (comment) (commit 7).
Closes #31: this was fixed in 1.6.0.
Closes #37: the bug in VS Code Preview doesn't happen anymore.
Closes #46, closes #56, closes #87: links in headings are supported in the latest version, can be closed.
Closes #52: comments in code blocks aren't parsed as headings in the latest version, can be closed.
Closes #53: orderedList:true plays well with updateOnSave in the latest version, can be closed.
Closes #59: can't reproduce after this PR is merged.
Closes #62: feature request already exists with depthFrom:2.
Closes #64, closes #69, closes #75: the bug happens because of wrong markdown syntax, can be closed.
Closes #74: can't reproduce after this PR is merged.
Closes #84: can't reproduce after this PR is merged.

- Add eslint
- Update .vscode settings
- Substitute vscode for @types/vscode and vscode-test packages
- Update package.json scripts
- Update tsconfig and remove typings folder
- Update vsc-extension-quickstart document
@JulienGrv
Copy link

@alanwalk please merge :)

Fixes wrong removal of _ in headers introduced in fe9b778

Fixes alanwalk#30
This fixes the case where different titles get the same hash. In the old
version, the repetition number was tracked with the title; since they
didn't match, the repetition number wasn't incremented.

Now, the repetition number is tracked from the hash (#title), so they
get the correct repetition.

Fixes alanwalk#93
@mcornella mcornella changed the title Refactor: various fixes Refactor and many many fixes Nov 2, 2020
@Flowkap
Copy link

Flowkap commented Nov 12, 2020

Any eta? Thanks for your efforts! Really appreciated!

@kulak
Copy link

kulak commented Jan 16, 2021

How can I get this version of extension?

@mcornella
Copy link
Author

I tried contacting the author a few times but I get no response. I submitted the PR because I knew this extension was used by many people and I could have the greatest impact, so I really don't want to go the way other PR authors have and create a new extension.

@Jenriksen
Copy link

I tried contacting the author a few times but I get no response. I submitted the PR because I knew this extension was used by many people and I could have the greatest impact, so I really don't want to go the way other PR authors have and create a new extension.

It almost seems like abandonment of the project, perhaps it is needed to create a new project based on this to implement your changes?
I know that it is not the preferable way of doing it.

@kulak
Copy link

kulak commented Jan 20, 2021

I ended up looking at all forks of this project and there is one that seems to have progressed in the good direction. This fork is easy to spot, because it has forks of its own. It appears to have fixed at least some issues mentioned here. so, I ended up installing extension from that fork.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.