p4535992 / foundryvtt-chat-portrait

Other
2 stars 6 forks source link

[BUG] the first Image in 'message-content' is being moved to the 'flavor-text' #52

Open admiralnlson opened 3 months ago

admiralnlson commented 3 months ago

Module Version: v1.0.1 This is not new though. The same problem existed 2+ years ago (I noticed this as I was watching an old youtube video of a group of players using my system with your module).

Before open any issue N/A. No console log is produced by the module.

Describe the bug The module moves the 1st image located within the message-content of chat messages to the flavor-text span, and reshapes it as a square.

To Reproduce Reproduction steps on how to generate a message like the one below with the Castle Falkenstein system would be quite cumbersome. I've provided the HTML code of the chat message instead.

Expected behavior With default settings for the module, I expect the message structure to not be altered aside from adding a portrait in the top left corner. More specifically, I expected images located within the message-content of chat messages to be left untouched.

Screenshots How the message looks without "Chat Portrait" module: image

<li class="chat-message message flexcol ic" data-message-id="8YAnK3fRM3tSBkR1">
    <header class="message-header flexrow">
        <h4 class="message-sender">Alphonse Dumas</h4>
        <span class="message-metadata">
            <time class="message-timestamp">2m ago</time>
            <a aria-label="Delete" class="message-delete"><i class="fas fa-trash"></i></a>
        </span>

        <span class="flavor-text">[Perform Feat]</span>
    </header>
    <div class="message-content">
        Good [6] <b>Perception</b> [<span class="suit-symbol-diamonds">♦</span>]<hr><div class="cards-played"><img class="card-played correct-suit" src="systems/castle-falkenstein/src/cards/small/diamonds-9.svg" alt="9 of Diamonds" title="9 of Diamonds"><img class="card-played " src="systems/castle-falkenstein/src/cards/small/spades-8.svg" alt="8 of Spades" title="8 of Spades"></div><hr><button type="button" class="feat-chat-ranges-button">16</button><div class="feat-chat-ranges-collapsible">  <div class="grid grid-2col feat-chat-ranges">    <span class="feat-chat-range">0-8</span><span>High Success</span>    <span class="feat-chat-range">9-10</span><span>Full Success</span>    <span class="feat-chat-range">11-16</span><span>Partial Success</span>    <span class="feat-chat-range">17-32</span><span>Failure</span>    <span class="feat-chat-range">33+</span><span>Fumble</span>  </div></div>
    </div>
</li>

How the message looks without "Chat Portrait" module and default settings: image

<li class="chat-message message flexcol ic" data-message-id="8YAnK3fRM3tSBkR1" style="border-color: rgb(255, 0, 0);">
    <header class="message-header flexrow chat-portrait-message-header-generic"><img src="worlds/chateau-falkenstein/player-uploads/sepia-alphonse-face.webp" width="36" height="36" class="chat-portrait-message-portrait-generic" style="border: 2px solid rgb(255, 0, 0);">
        <h4 class="message-sender chat-portrait-text-size-name-generic" style="align-self: center;">Alphonse Dumas</h4>
        <span class="message-metadata">
            <time class="message-timestamp">3m ago</time>
            <a aria-label="Delete" class="message-delete"><i class="fas fa-trash"></i></a>
        </span>

        <span class="flavor-text chat-portrait-text-size-name-generic"><img class="card-played correct-suit chat-portrait-image-size-name-generic" src="systems/castle-falkenstein/src/cards/small/diamonds-9.svg" alt="9 of Diamonds" title="9 of Diamonds" width="36" height="36">[Perform Feat]</span>
    </header>
    <div class="message-content"><h4 class="chat-portrait-text-content-name-generic chat-portrait-flexrow"></h4>
        Good [6] <b>Perception</b> [<span class="suit-symbol-diamonds">♦</span>]<hr><div class="cards-played"><img class="card-played " src="systems/castle-falkenstein/src/cards/small/spades-8.svg" alt="8 of Spades" title="8 of Spades"></div><hr><button type="button" class="feat-chat-ranges-button">16</button><div class="feat-chat-ranges-collapsible">  <div class="grid grid-2col feat-chat-ranges">    <span class="feat-chat-range">0-8</span><span>High Success</span>    <span class="feat-chat-range">9-10</span><span>Full Success</span>    <span class="feat-chat-range">11-16</span><span>Partial Success</span>    <span class="feat-chat-range">17-32</span><span>Failure</span>    <span class="feat-chat-range">33+</span><span>Fumble</span>  </div></div>
    </div>
</li>

Browser:

Foundry Version: 12.330

Game System: castle-falkenstein

Additional context N/A