Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property 'blockTokenizers' does not exist of type 'RemarkParser' #499

Closed
tmm opened this issue Jun 3, 2020 · 6 comments
Closed

Property 'blockTokenizers' does not exist of type 'RemarkParser' #499

tmm opened this issue Jun 3, 2020 · 6 comments
Labels
☂️ area/types This affects typings 💪 phase/solved Post is done

Comments

@tmm
Copy link

tmm commented Jun 3, 2020

Curious why blockTokenizers aren't added to the type, but blockMethods are.

declare class RemarkParser implements Parser {
parse(): Node
blockMethods: string[]
inlineTokenizers: {
[key: string]: remarkParse.Tokenizer
}
inlineMethods: string[]
}

I'm trying to override blankLine and get a Property 'blockTokenizers' does not exist of type 'RemarkParser' error:

const blockTokenizers = remarkParse.Parser.prototype.blockTokenizers // type error here
blockTokenizers.blankLine = tokenize.blankLine

Would it work to add the following?

declare class RemarkParser implements Parser { 
  ...
  blockTokenizers: {
    [key: string]: remarkParse.Tokenizer
  }
  ...
}
@ChristianMurphy
Copy link
Member

@tmm if this is a question, https://spectrum.chat/unified/type-definitions would be the best place for this.
If this is a bug report/feature request please fill out the issue template
https://github.com/remarkjs/.github/blob/master/.github/ISSUE_TEMPLATE/1-bug.md
or https://github.com/remarkjs/.github/blob/master/.github/ISSUE_TEMPLATE/2-feature.md

@ChristianMurphy ChristianMurphy added 🙉 open/needs-info This needs some more info ☂️ area/types This affects typings labels Jun 3, 2020
@tmm
Copy link
Author

tmm commented Jun 3, 2020

posted on spectrum. closing for now.

will re-open with the proper template later if necessary.

thanks for triaging quickly.

@dwjohnston
Copy link

@ChristianMurphy @tmm can you tell me what the resolution for this was?

@wooorm
Copy link
Member

wooorm commented Jul 4, 2022

This is a question about a feature that was removed two years ago. The resolution is: don’t use 2 year old features. Ask new questions following our support guide to get help.

@dwjohnston
Copy link

dwjohnston commented Jul 4, 2022

@wooorm lol fair enough. If you see the above link back you see that this relates to a plugin (remark-grid-tables) that no longer works with remark-parse@9 and so this issue just came up as part of that investigation.

On the chance that migrating plugins is straight forward - do you know how I would convert some some code that looks like this:

export default function plugin () {

  const Parser = this.Parser

  // Inject blockTokenizer
  const blockTokenizers = Parser.prototype.blockTokenizers
  const blockMethods = Parser.prototype.blockMethods
  blockTokenizers.gridTable = gridTableTokenizer
  blockMethods.splice(blockMethods.indexOf('fencedCode') + 1, 0, 'gridTable')

to the remark-parse@10 way of doing things?

@wooorm
Copy link
Member

wooorm commented Jul 5, 2022

The answer to “how to use a plugin that does not work anymore”, namely remark-grid-tables, is solved by looking at the issues of that plugin. As far as I am aware, they are looking for help.
No, it is not trivial. It is extremely complex.

@remarkjs remarkjs locked as resolved and limited conversation to collaborators Jul 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
☂️ area/types This affects typings 💪 phase/solved Post is done
Development

No branches or pull requests

4 participants