fountain-js
Advanced tools
Comparing version 1.2.3 to 1.2.4
@@ -13,2 +13,10 @@ # Change Log | ||
## [1.2.4] - 2023-11-13 | ||
### Fixed | ||
- Fixed a bug where if a key-value pair within the title page block is invalid, it would throw it into a endless loop. Now the remainder of the block falls to action until the block is corrected. | ||
- Fixed another bug where a colon (`:`) within the value portion of the tile page key-value pair would be truncated after the colon. | ||
- Upgraded to Typscript `^5.0` to avoid breaking changes with `@types/node`. | ||
## [1.2.3] - 2023-11-13 | ||
@@ -24,3 +32,3 @@ | ||
- Title page is only recognized at the beginning of script (leading whitespace is ignored), any other title pages after the start becomes action as per Fountain specification. | ||
- Fixed longstanding issue (even from the original version) where any additional lines after certain tokens like scene headings, for example `EXT. BRICK'S GARAGE - DAY\nTrailing action...`, is consumed and lost by the lexer. Now both token and additional lines fall to action instead since these specific tokens require newliens after them to be valid. | ||
- Fixed longstanding issue (even from the original version) where any additional lines after certain tokens like scene headings, for example `EXT. BRICK'S GARAGE - DAY\nTrailing action...`, is consumed and lost by the lexer. Now both token and additional lines fall to action instead since these specific tokens require newlines after them to be valid. | ||
@@ -27,0 +35,0 @@ ### Changed |
import { Token } from './token'; | ||
export declare type InlineTypes = 'note' | 'line_break' | 'bold_italic_underline' | 'bold_underline' | 'italic_underline' | 'bold_italic' | 'bold' | 'italic' | 'underline' | 'escape'; | ||
export type InlineTypes = 'note' | 'line_break' | 'bold_italic_underline' | 'bold_underline' | 'italic_underline' | 'bold_italic' | 'bold' | 'italic' | 'underline' | 'escape'; | ||
export declare class Lexer { | ||
@@ -4,0 +4,0 @@ private static lastLineWasDualDialogue; |
@@ -1,2 +0,2 @@ | ||
export declare type FountainTypes = 'title_page' | 'scene_heading' | 'scene_number' | 'transition' | 'dialogue' | 'parenthetical' | 'action' | 'centered' | 'lyrics' | 'synopsis' | 'section' | 'note' | 'note_inline' | 'boneyard' | 'page_break' | 'line_break' | 'bold_italic_underline' | 'bold_underline' | 'italic_underline' | 'bold_italic' | 'bold' | 'italic' | 'underline' | 'escape' | 'blank_lines'; | ||
export type FountainTypes = 'title_page' | 'scene_heading' | 'scene_number' | 'transition' | 'dialogue' | 'parenthetical' | 'action' | 'centered' | 'lyrics' | 'synopsis' | 'section' | 'note' | 'note_inline' | 'boneyard' | 'page_break' | 'line_break' | 'bold_italic_underline' | 'bold_underline' | 'italic_underline' | 'bold_italic' | 'bold' | 'italic' | 'underline' | 'escape' | 'blank_lines'; | ||
export declare const rules: Record<FountainTypes, RegExp>; |
@@ -19,2 +19,6 @@ import { rules } from './rules'; | ||
} | ||
else { | ||
this.scanIndex = scanPosition; | ||
break; | ||
} | ||
} | ||
@@ -33,3 +37,3 @@ } | ||
this.is_title = true; | ||
const [key, delimeter, value] = pair.split(/(\:[^\S\n]*\n?)/, 3); | ||
const [key, delimeter, value] = pair.split(/(\:[^\S\n]*\n?)([\S\s]*)/, 3); | ||
this.type = key.trim().toLowerCase().replace(/ /g, '_'); | ||
@@ -36,0 +40,0 @@ this.text = value.replace(/^\s*|\s*$/gm, ''); |
@@ -20,3 +20,3 @@ "use strict"; | ||
// lexes any inlines on the title then removes any HTML / line breaks | ||
title = utilities_1.unEscapeHTML(lexer_1.InlineLexer.reconstruct(titleToken.text) | ||
title = (0, utilities_1.unEscapeHTML)(lexer_1.InlineLexer.reconstruct(titleToken.text) | ||
.replace('<br />', ' ') | ||
@@ -23,0 +23,0 @@ .replace(/<(?:.|\n)*?>/g, '')); |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -10,5 +14,6 @@ if (k2 === undefined) k2 = k; | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.InlineLexer = exports.Lexer = exports.rules = void 0; | ||
__exportStar(require("./fountain"), exports); | ||
@@ -15,0 +20,0 @@ var rules_1 = require("./rules"); |
import { Token } from './token'; | ||
export declare type InlineTypes = 'note' | 'line_break' | 'bold_italic_underline' | 'bold_underline' | 'italic_underline' | 'bold_italic' | 'bold' | 'italic' | 'underline' | 'escape'; | ||
export type InlineTypes = 'note' | 'line_break' | 'bold_italic_underline' | 'bold_underline' | 'italic_underline' | 'bold_italic' | 'bold' | 'italic' | 'underline' | 'escape'; | ||
export declare class Lexer { | ||
@@ -4,0 +4,0 @@ private static lastLineWasDualDialogue; |
@@ -127,3 +127,3 @@ "use strict"; | ||
]; | ||
line = utilities_1.escapeHTML(line.replace(rules_1.rules.escape, '[{{{$&}}}]') // perserve escaped characters | ||
line = (0, utilities_1.escapeHTML)(line.replace(rules_1.rules.escape, '[{{{$&}}}]') // perserve escaped characters | ||
); | ||
@@ -130,0 +130,0 @@ if (escapeSpaces) { |
@@ -1,2 +0,2 @@ | ||
export declare type FountainTypes = 'title_page' | 'scene_heading' | 'scene_number' | 'transition' | 'dialogue' | 'parenthetical' | 'action' | 'centered' | 'lyrics' | 'synopsis' | 'section' | 'note' | 'note_inline' | 'boneyard' | 'page_break' | 'line_break' | 'bold_italic_underline' | 'bold_underline' | 'italic_underline' | 'bold_italic' | 'bold' | 'italic' | 'underline' | 'escape' | 'blank_lines'; | ||
export type FountainTypes = 'title_page' | 'scene_heading' | 'scene_number' | 'transition' | 'dialogue' | 'parenthetical' | 'action' | 'centered' | 'lyrics' | 'synopsis' | 'section' | 'note' | 'note_inline' | 'boneyard' | 'page_break' | 'line_break' | 'bold_italic_underline' | 'bold_underline' | 'italic_underline' | 'bold_italic' | 'bold' | 'italic' | 'underline' | 'escape' | 'blank_lines'; | ||
export declare const rules: Record<FountainTypes, RegExp>; |
@@ -22,2 +22,6 @@ "use strict"; | ||
} | ||
else { | ||
this.scanIndex = scanPosition; | ||
break; | ||
} | ||
} | ||
@@ -37,3 +41,3 @@ } | ||
this.is_title = true; | ||
const [key, delimeter, value] = pair.split(/(\:[^\S\n]*\n?)/, 3); | ||
const [key, delimeter, value] = pair.split(/(\:[^\S\n]*\n?)([\S\s]*)/, 3); | ||
this.type = key.trim().toLowerCase().replace(/ /g, '_'); | ||
@@ -40,0 +44,0 @@ this.text = value.replace(/^\s*|\s*$/gm, ''); |
{ | ||
"name": "fountain-js", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"description": "A simple parser for Fountain, a markup language for formatting screenplays.", | ||
@@ -41,8 +41,8 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@types/jasmine": "^4.0.3", | ||
"jasmine": "^4.1.0", | ||
"rimraf": "^3.0.2", | ||
"@types/jasmine": "^5.1.2", | ||
"jasmine": "^5.1.0", | ||
"rimraf": "^5.0.5", | ||
"ts-node": "^10.7.0", | ||
"typescript": "^3.9.5" | ||
"typescript": "^5.2.2" | ||
} | ||
} |
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
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
110018
1623