Skip to content

Addressing PR comments#227

Draft
Claude wants to merge 4 commits intobetafrom
claude/support-multiline-dialogue
Draft

Addressing PR comments#227
Claude wants to merge 4 commits intobetafrom
claude/support-multiline-dialogue

Conversation

@Claude
Copy link
Copy Markdown
Contributor

@Claude Claude AI commented Feb 21, 2026

Original prompt

This section details on the original issue you should resolve

<issue_title>Support for multiline dialogue in fountain editor</issue_title>
<issue_description>It appears that in the editor multiline dialogue is not indented. As an example consider DAN's dialogue in these screenshots from ThiefMD 0.2.3.

Editor:
Screenshot from 2021-06-12 11-39-44

Preview:
Screenshot from 2021-06-12 11-43-02

I think if the _Permanently_. line could be indented like Then let's retire them. is it would help the visual clarity of the editor.

Thank you for your work on ThiefMD!

</issue_description>

Comments on the Issue (you are @claude[agent] in this section)

@kmwallio Thanks for raising this, I'll take a look at our regexes and rules to see if I can fix this.

- Added new tag_dialogue_continuation for continuation lines
- Modified regex to capture multiline dialogue blocks
- Updated tagging logic to distinguish first line from continuations
- Set continuation lines with increased left margin (2 chars more)
- Updated all tag management code to handle new tag

Co-authored-by: kmwallio <132455+kmwallio@users.noreply.github.com>
@Claude Claude AI changed the title [WIP] Add support for multiline dialogue indentation in editor Support multiline dialogue indentation in fountain editor Feb 21, 2026
@Claude Claude AI requested a review from kmwallio February 21, 2026 07:31
Comment thread src/Enrichments/Fountain.vala Outdated
scene_heading = new Regex ("\\n(ИНТ|НАТ|инт|нат|INT|EXT|EST|I\\/E|int|ext|est|i\\/e)[\\. \\/].*\\S\\s?\\r?\\n", RegexCompileFlags.BSR_ANYCRLF | RegexCompileFlags.NEWLINE_ANYCRLF | RegexCompileFlags.CASELESS, 0);
// character_dialogue = new Regex ("(?<=\\n)([ \\t]*[^<>a-z\\s\\/\\n][^<>a-z:!\\?\\n]*[^<>a-z\\(!\\?:,\\n\\.][ \\t]?|[ \\t]*\\(?[^\\n]\\)?[ \\t]*)\\n{1}(?!\\n)(.*?)\\r?\\n{1}", 0, 0);
character_dialogue = new Regex ("(?<=\\n)([ \\t]*?[^<>a-z\\s\\/\\n][^<>a-z:!\\?\\n]*[^<>a-z\\(!\\?:,\\n\\.][ \\t]?|\\([^\\n]+\\))\\n{1}(?!\\n)(.+?)\\n{1}", RegexCompileFlags.BSR_ANYCRLF | RegexCompileFlags.NEWLINE_ANYCRLF, 0);
// Modified to capture multiline dialogue: matches character name followed by all dialogue lines until blank line
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@claude[agent] This seems to be capturing empty lines

This should be multi-line dialogue (Line one and Line two are dialog):

CHARACTER
Line one
Line two

This should not be multi-line dialogue:

CHARACTER
Line one

Line two

In this case, Line one is dialogue. Line two is action.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in a8b6c68. Updated regex to (?:[^\n]+\n(?!\n))*[^\n]+ which matches only non-blank lines that are NOT followed by blank lines. Now correctly stops at the first blank line, treating subsequent text as action rather than dialogue.

The previous regex captured across blank lines. Updated pattern now
correctly stops when encountering a blank line (double newline).

Pattern: (?:[^\n]+\n(?!\n))*[^\n]+ matches lines that are NOT followed
by blank lines, ensuring dialogue stops at the first blank line as per
Fountain spec.

Co-authored-by: kmwallio <132455+kmwallio@users.noreply.github.com>
@Claude Claude AI changed the title Support multiline dialogue indentation in fountain editor Addressing PR comments Feb 22, 2026
@Claude Claude AI requested a review from kmwallio February 22, 2026 06:21
@kmwallio
Copy link
Copy Markdown
Owner

@claude[agent] actions after dialog are still being marked as dialog instead of actions.

Changed from skipping empty lines to breaking the loop when an empty
line is encountered. This ensures text after blank lines is treated
as action, not dialogue continuation.

Previously, if the regex captured text across a blank line, the tagging
loop would skip the blank and continue tagging subsequent lines as
dialogue. Now it correctly stops at the first blank line.

Co-authored-by: kmwallio <132455+kmwallio@users.noreply.github.com>
@Claude
Copy link
Copy Markdown
Contributor Author

Claude AI commented Feb 22, 2026

@claude[agent] actions after dialog are still being marked as dialog instead of actions.

Fixed in 70e0d36. Changed the tagging loop from skipping empty lines to breaking when encountering them. Now text after blank lines is correctly left untagged (treated as action) instead of being tagged as dialogue continuation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants