fix: strip trailing bracket from room-window title (no more "]]") - #43
Merged
MahtraDR merged 1 commit intoAug 6, 2026
Merged
Conversation
Problem: RoomDataProcessor#process_room_data captured the room-window title with
"text.sub(/^\[/, '').sub(/\]\s*\(/, ' (').strip", which removes the leading "["
unconditionally but only removes the closing "]" when it is immediately followed
by a "(" (the "[Room] (230008)" RealID form). A bracketed title WITHOUT a trailing
"(number)" - e.g. "[Room - 2071]" (Lich's ";display lichid" + "roomid title" when
the game RealID is absent) or a plain "[Town Square]" - kept its trailing "]".
RoomWindow#render then re-brackets the title ("[#{@title}]"), doubling it into
"[Room - 2071]]".
Fix: Also strip a trailing "]" (".sub(/\]\s*\z/, '')") so the captured title is
always bracket-free regardless of whether the game appended a RealID. render then
adds exactly one pair of brackets.
Tests: New spec/lib/room_data_processor_spec.rb drives #process_room_data in
:title mode over the RealID, lich-id-only, plain, and combined title shapes, plus
adversarial "no stray ]" and no-RoomWindow cases. Full suite green: 852 examples,
0 failures; rubocop clean on touched files.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
RoomDataProcessor#process_room_datacaptured the room-window title with:That removes the leading
[unconditionally, but only removes the closing]when it is immediately followed by a(— i.e. the[Room] (230008)RealID form. A bracketed title without a trailing(number)keeps its]:[Bosque Deriel, Hermit's Shacks - 2071]— Lich's;display lichid+;display roomid titlewhen the game RealID isn't appended →Bosque Deriel, Hermit's Shacks - 2071][Town Square]— any plain room →Town Square]RoomWindow#renderthen re-brackets the title ("[#{@title}]"), doubling the stray bracket into[Bosque Deriel, Hermit's Shacks - 2071]].(Surfaced while chasing a doubled
]alongside elanthia-online/lich-5#1500; that Lich PR fixes the DR side by preserving the game RealID, but this front-end regex is independently buggy for any bracketed title lacking a trailing(number).)Fix
Also strip a trailing
], so the captured title is always bracket-free regardless of whether the game appended a RealID:renderthen adds exactly one pair of brackets.[Room] (230008)Room (230008)[Room] (230008)[Room - 2071]Room - 2071[Room - 2071](was[Room - 2071]])[Town Square]Town Square[Town Square](was[Town Square]])[Room - 2071] (230008)Room - 2071 (230008)[Room - 2071] (230008)Tests
New
spec/lib/room_data_processor_spec.rbdrives#process_room_datain:titlemode over the RealID, lich-id-only, plain, and combined title shapes, plus adversarial "leaves no stray]" and no-RoomWindow cases.Full suite green: 852 examples, 0 failures;
rubocopclean on touched files.🤖 Generated with Claude Code