-
Notifications
You must be signed in to change notification settings - Fork 220
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
imprv: Update dependencies due to unified package upgrade #8995
imprv: Update dependencies due to unified package upgrade #8995
Conversation
…/148445-15079-update-dependencies
…/148445-15079-update-dependencies
|
@@ -5,7 +5,7 @@ import { findAfter } from 'unist-util-find-after'; | |||
import { visit } from 'unist-util-visit'; | |||
|
|||
|
|||
function wrapWithSection(parentNode: Parent, startElem: Node, endElem: Node | null, isDarkMode?: boolean): void { | |||
function wrapWithSection(parentNode: Parent, startElem: Node, endElem: Node | undefined | null, isDarkMode?: boolean): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
endElem?: Node | null
で書けそう?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
書き換えました。
type Lang = 'drawio'; | ||
|
||
function isDrawioBlock(lang: unknown): lang is Lang { | ||
return /^drawio$/.test(lang as string); | ||
function isDrawioBlock(lang: string | undefined | null): lang is Lang { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lang?: string | null
で書けそう?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
書き換えました。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- import 文の as 利用は OK
- memolized component の
as typeof
利用も OK - 処理ステートメント中の as (たとえば
(node as Code)
など) は、こんなに多用しないといけないのはなんか釈然としない- type guard とかないのか?
- ないなら作ってはどうか?as Parent や as Code のケースが多そうなのである程度共通化もできそう
// if inlineCode, properties.inline exists. | ||
if (element.properties?.inline != null) { | ||
element.properties.inline = true; | ||
addClassToProperties(element.properties, 'inline'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sanitize の設定を見直すことで class には入れなくても property として扱えると思う
getCommonSanitizeOption を呼んで rehypeSanitizePlugin を作っているところで code 用の設定も入れ込む
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sanitize を設定し、property から inline を判断するようにしました。
7d0a6fa
into
imprv/148445-upgrade-remark-growi-directive
Summary
Task
Note
hast-util-sanitize/lib
の lint error は後続タスクで解決予定(これ以外の lint error はおそらく無い)remark-growi-directive
を使用しているパッケージ等が any を使っているものは後続タスクで解決予定inlineCode
との判別方法を提供しなくなったので、 remark-plugins/codeblock.ts で無理やり判別している。