fountain-js
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -9,2 +9,13 @@ # Change Log | ||
## [1.1.1] - 2023-09-13 | ||
### Fixed | ||
- Special characters like `#`, `$`, `%`, etc., now work in character names and are valid. | ||
- Per specification, character names like `23` do not work but numbers in character names work regardless of order e.g. `R2D2` or `11A`. | ||
### Changed | ||
- You can force a character name with all numbers e.g. `123`, if desired. | ||
## [1.1.0] - 2023-06-26 | ||
@@ -11,0 +22,0 @@ |
@@ -6,3 +6,3 @@ export const regex = { | ||
transition: /^((?:FADE (?:TO BLACK|OUT)|CUT TO BLACK)\.|.+ TO\:)|^(?:> *)(.+)/, | ||
dialogue: /^(?:([A-Z*_][0-9A-Z ._\-']*(?:\(.*\))?[ ]*)|\@([A-Za-z*_][0-9A-Za-z (._\-')]*))(\^?)?(?:\n(?!\n+))([\s\S]+)/, | ||
dialogue: /(?!^[0-9 _*]+(?:\(.*\))?[ *_]*(?:\^?)?\s*\n)(^(?:(?!\\?@|!)[^\^\(\)\na-z]+|@[^\^\(\)\n]+)(?:[ ]*\(.*\))?[ *_]*)(\^?)?\s*(?:\n(?!\n+))([\s\S]+)/, | ||
parenthetical: /^(\(.+\))$/, | ||
@@ -9,0 +9,0 @@ action: /^(.+)/g, |
@@ -74,5 +74,8 @@ import { regex } from './regex'; | ||
const match = line.match(regex.dialogue); | ||
let name = match[1] || match[2]; | ||
let name = match[1]; | ||
if (name.startsWith('@')) { | ||
name = name.substring(1); | ||
} | ||
// iterating from the bottom up, so push dialogue blocks in reverse order | ||
const isDualDialogue = !!(match[3]); | ||
const isDualDialogue = !!(match[2]); | ||
if (isDualDialogue) { | ||
@@ -82,3 +85,3 @@ this.tokens.push(new DualDialogueEndToken()); | ||
this.tokens.push(new DialogueEndToken()); | ||
const parts = match[4].split(/(\(.+\))(?:\n+)/).reverse(); | ||
const parts = match[3].split(/(\(.+\))(?:\n+)/).reverse(); | ||
this.tokens.push(...parts.reduce((p, text = '') => { | ||
@@ -85,0 +88,0 @@ if (!text.length) { |
@@ -9,3 +9,3 @@ "use strict"; | ||
transition: /^((?:FADE (?:TO BLACK|OUT)|CUT TO BLACK)\.|.+ TO\:)|^(?:> *)(.+)/, | ||
dialogue: /^(?:([A-Z*_][0-9A-Z ._\-']*(?:\(.*\))?[ ]*)|\@([A-Za-z*_][0-9A-Za-z (._\-')]*))(\^?)?(?:\n(?!\n+))([\s\S]+)/, | ||
dialogue: /(?!^[0-9 _*]+(?:\(.*\))?[ *_]*(?:\^?)?\s*\n)(^(?:(?!\\?@|!)[^\^\(\)\na-z]+|@[^\^\(\)\n]+)(?:[ ]*\(.*\))?[ *_]*)(\^?)?\s*(?:\n(?!\n+))([\s\S]+)/, | ||
parenthetical: /^(\(.+\))$/, | ||
@@ -12,0 +12,0 @@ action: /^(.+)/g, |
@@ -82,5 +82,8 @@ "use strict"; | ||
const match = line.match(regex_1.regex.dialogue); | ||
let name = match[1] || match[2]; | ||
let name = match[1]; | ||
if (name.startsWith('@')) { | ||
name = name.substring(1); | ||
} | ||
// iterating from the bottom up, so push dialogue blocks in reverse order | ||
const isDualDialogue = !!(match[3]); | ||
const isDualDialogue = !!(match[2]); | ||
if (isDualDialogue) { | ||
@@ -90,3 +93,3 @@ this.tokens.push(new DualDialogueEndToken()); | ||
this.tokens.push(new DialogueEndToken()); | ||
const parts = match[4].split(/(\(.+\))(?:\n+)/).reverse(); | ||
const parts = match[3].split(/(\(.+\))(?:\n+)/).reverse(); | ||
this.tokens.push(...parts.reduce((p, text = '') => { | ||
@@ -93,0 +96,0 @@ if (!text.length) { |
{ | ||
"name": "fountain-js", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "A simple parser for Fountain, a markup language for formatting screenplays.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
90244
1407
0