club-1 / flarum-ext-cross-references

Add cross reference links when a discussion is mentioned from another one.
GNU Affero General Public License v3.0
6 stars 1 forks source link

Discussion title will not properly render when the title contains cjk characters and the slug driver is on utf-8 #41

Closed alligatorrrr closed 1 year ago

alligatorrrr commented 1 year ago

Current Behavior

Discussion title will not properly render when the title contains CJK characters (CHINESE/ JAPANESE/ KOREAN) and the slug driver is on utf-8, it will still render the whole link instead of the title of the discussion.

type in the link in composer: (render properly when it's in preview mode)

截屏2023-04-05 16 03 07

back to the whole link when the post has been sent:

截屏2023-04-05 16 03 13

Expected Behavior

No response

Steps To Reproduce

  1. create a discussion with a title in cjk characters
  2. set the slug driver to utf-8 in admin panel
  3. reference the discussion in another discussion

Environment

Flarum core: 1.7.1 PHP version: 8.0.26 MySQL version: 5.7.40-log

Output of php flarum info

Flarum core: 1.7.1
PHP version: 8.0.26
MySQL version: 5.7.40-log
Loaded extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, bcmath, ctype, curl, dom, filter, ftp, gd, gettext, hash, iconv, intl, json, mbstring, SPL, session, pcntl, standard, PDO, mysqlnd, pdo_sqlite, Phar, posix, Reflection, pdo_mysql, shmop, SimpleXML, soap, sockets, sodium, mysqli, sysvsem, tokenizer, xml, xmlreader, xmlwriter, zip, fileinfo, redis, exif, gmp
+------------------------------------------+----------+--------+
| Flarum Extensions                        |          |        |
+------------------------------------------+----------+--------+
| ID                                       | Version  | Commit |
+------------------------------------------+----------+--------+
| flarum-flags                             | v1.7.0   |        |
| flarum-approval                          | v1.7.0   |        |
| askvortsov-auto-moderator                | v0.1.2   |        |
| flarum-likes                             | v1.7.0   |        |
| flarum-subscriptions                     | v1.7.0   |        |
| flarum-tags                              | v1.7.1   |        |
| flarum-lock                              | v1.7.0   |        |
| antoinefr-money                          | v1.2.0   |        |
| flarum-sticky                            | v1.7.0   |        |
| flarum-markdown                          | v1.7.0   |        |
| flarum-bbcode                            | v1.7.0   |        |
| fof-follow-tags                          | 1.1.7    |        |
| flarum-suspend                           | v1.7.0   |        |
| flamarkt-backoffice                      | 0.1.3    |        |
| v17development-blog                      | v0.6.5   |        |
| flarum-mentions                          | v1.7.0   |        |
| afrux-forum-widgets-core                 | v0.1.7   |        |
| ziiven-ziven-badge-shop                  | dev-main |        |
| ziiven-pay-to-see                        | v1.1.1   |        |
| zerosonesfun-member                      | 1.2      |        |
| zerosonesfun-bbcode-button               | 1.1.3    |        |
| zequeen-acgembed-remastered              | v1.1.2   |        |
| yannisme-oxotheme                        | 2.1.5    |        |
| v17development-user-badges               | v1.1.0   |        |
| v17development-seo                       | v1.8.0   |        |
| the-turk-stickiest                       | 3.0.1    |        |
| the-turk-flamoji                         | 1.0.4    |        |
| sycho-profile-cover                      | v1.3.3   |        |
| nearata-internal-links-noreload          | v2.1.3   |        |
| nearata-cakeday                          | v2.1.0   |        |
| matteocontrini-imgur-upload              | v3.9.1   |        |
| littlecxm-reply-to-see                   | 1.0.2    |        |
| kyrne-whisper                            | 0.1.4    |        |
| kilowhat-rich-embeds                     | 1.2.4    |        |
| justoverclock-hashtag                    | 1.0.1    |        |
| justoverclock-feedback                   | 0.1.9    |        |
| ianm-follow-users                        | 1.2.0    |        |
| ganuonglachanh-sonic                     | 0.1.8    |        |
| fof-user-bio                             | 1.1.1    |        |
| fof-upload                               | 1.2.3    |        |
| fof-pretty-mail                          | 1.1.1    |        |
| fof-polls                                | 1.3.0    |        |
| fof-nightmode                            | 1.5.1    |        |
| fof-masquerade                           | 2.1.3    |        |
| fof-links                                | 1.1.3    |        |
| fof-linguist                             | 1.1.0    |        |
| fof-frontpage                            | 1.1.1    |        |
| fof-formatting                           | 1.0.3    |        |
| fof-drafts                               | 1.2.2    |        |
| fof-doorman                              | 1.1.2    |        |
| flarumite-simple-discussion-views        | 1.1.6    |        |
| flarum-statistics                        | v1.7.0   |        |
| flarum-nicknames                         | v1.7.0   |        |
| flarum-lang-russian                      | 1.11.0   |        |
| flarum-lang-english                      | v1.7.0   |        |
| flarum-lang-chinese-simplified           | v1.3.0   |        |
| flamarkt-taxonomies                      | 0.1.9    |        |
| datlechin-usercard-uid                   | v0.1.1   |        |
| datlechin-scroll-buttons                 | v1.1.0   |        |
| datlechin-copy-links                     | v0.1.1   |        |
| datlechin-bbcode-hide-content            | v0.1.5   |        |
| darkle-fancybox                          | 1.1.2    |        |
| club-1-cross-references                  | v1.0.4   |        |
| clarkwinkelmann-see-past-first-post      | 1.3.1    |        |
| clarkwinkelmann-roll-die                 | 1.0.0    |        |
| clarkwinkelmann-post-stream-search       | 1.0.1    |        |
| clarkwinkelmann-post-bookmarks           | 1.0.0    |        |
| clarkwinkelmann-money-to-all             | 1.0.0    |        |
| clarkwinkelmann-money-rewards            | 1.0.0    |        |
| clarkwinkelmann-discussion-open-position | 1.1.0    |        |
| clarkwinkelmann-discussion-lists         | 1.0.0    |        |
| clarkwinkelmann-composer-page            | 1.0.0    |        |
| clarkwinkelmann-anonymous-posting        | 1.1.1    |        |
| blomstra-cache-assets                    | 0.5      |        |
| askvortsov-pwa                           | v3.1.3   |        |
| askvortsov-discussion-templates          | v0.8.3   |        |
| askvortsov-categories                    | v3.0.8   |        |
| annonny-gpt-bot                          | dev-main |        |
| annonny-date-filter                      | dev-main |        |
| afrux-news-widget                        | v0.1.1   |        |
| afrux-forum-stats-widget                 | v0.1.1   |        |
| acpl-mobile-tab                          | 1.1.1    |        |
n-peugnet commented 1 year ago

I think this is an instance of this known issue. Please follow the instructions and post the stack trace here if you can find one in the logs.

EDIT: I just tested and I can reproduce it locally. I will look into it.