fix #4001 ブログコメント管理:文字色の相違がある件を修正#4405
Open
kaburk wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
ブログコメント管理画面などで BcTextHelper::autoLinkUrls() を利用した際に、ドメインのみのURL(例: https://example.com/)の末尾スラッシュがリンク(</a>)の外に出てしまい、スラッシュだけ文字色が変わる表示崩れを回避するための修正です。CakePHP本体の TextHelper::autoLinkUrls() の出力に対して、壊れたパターンに限定した後処理で補正しています。
Changes:
BcTextHelper::autoLinkUrls()をオーバーライドし、リンク化後テキストに対して末尾スラッシュの表示崩れを補正- 補正用の正規表現処理(壊れたHTMLパターンのみ対象)を
protectedメソッドとして追加 - 末尾スラッシュ補正のユニットテストを追加
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| plugins/baser-core/src/View/Helper/BcTextHelper.php | autoLinkUrls() の結果に対し、</a>/ となる壊れた末尾スラッシュだけをリンク内へ戻す補正を追加 |
| plugins/baser-core/tests/TestCase/View/Helper/BcTextHelperTest.php | ドメインのみURLで末尾スラッシュがリンク外に出ないことを検証するテストを追加 |
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.
よろしくお願いします。