forked from MarkBind/markbind
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adapt core/src/lib/markdown-it to TypeScript
- Loading branch information
1 parent
0dec537
commit 08e0bac
Showing
9 changed files
with
266 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
// Common helper functions to be used in HighlightRule or HighlightRuleComponent | ||
|
||
function splitCodeAndIndentation(codeStr) { | ||
export function splitCodeAndIndentation(codeStr: string) { | ||
const codeStartIdx = codeStr.search(/\S|$/); | ||
const indents = codeStr.substring(0, codeStartIdx); | ||
const content = codeStr.substring(codeStartIdx); | ||
return [indents, content]; | ||
} | ||
|
||
module.exports = { | ||
splitCodeAndIndentation, | ||
}; |
Oops, something went wrong.