-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1837 from microsoft/u/juliaroldi/bump-roosterjs-v…
…ersion Bump RoosterJS to v8.48.0 and Content-Model package to 0.7.0
- Loading branch information
Showing
123 changed files
with
4,861 additions
and
2,323 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
10 changes: 0 additions & 10 deletions
10
packages/roosterjs-content-model/lib/domUtils/hasSpacesOnly.ts
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
packages/roosterjs-content-model/lib/domUtils/stringUtil.ts
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// A regex to match text that only has space and CR | ||
// We use real space char " " (\u0020) here but not "\s" since "\s" will also match " " (\u00A0) which is something we need to keep | ||
const SPACE_TEXT_REGEX = /^[\r\n\t ]*$/; | ||
|
||
const SPACES_REGEX = /[\u2000\u2009\u200a\u200b\u202f\u205f\u3000\s\t\r\n]/gm; | ||
const PUNCTUATIONS = '.,?!:"()[]\\/'; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export function isPunctuation(char: string) { | ||
return PUNCTUATIONS.indexOf(char) >= 0; | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export function isSpace(char: string) { | ||
const code = char?.charCodeAt(0) ?? 0; | ||
return code == 160 || code == 32 || SPACES_REGEX.test(char); | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export function hasSpacesOnly(txt: string): boolean { | ||
return SPACE_TEXT_REGEX.test(txt); | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export function normalizeText(txt: string, isForward: boolean): string { | ||
return txt.replace(isForward ? /^\u0020+/ : /\u0020+$/, '\u00A0'); | ||
} |
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
Oops, something went wrong.