This commit is contained in:
parent
9e67ed202b
commit
2055113f4b
2 changed files with 5 additions and 5 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
---
|
||||||
name: lint
|
name: lint
|
||||||
run-name: lint is launched by ${{ github.actor }}
|
run-name: lint is launched by ${{ github.actor }}
|
||||||
on: [push]
|
on: [push]
|
||||||
|
@ -12,7 +13,7 @@ jobs:
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Install linters using Composer
|
- name: Install linters using Composer
|
||||||
run: |
|
run: |
|
||||||
export COMPOSER_HOME=/tmp
|
export COMPOSER_HOME=/tmp
|
||||||
echo "{}" > composer.json
|
echo "{}" > composer.json
|
||||||
composer config --no-interaction allow-plugins.bamarni/composer-bin-plugin true
|
composer config --no-interaction allow-plugins.bamarni/composer-bin-plugin true
|
||||||
|
@ -22,6 +23,5 @@ jobs:
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: vendor/bin/phplint --no-cache --no-progress --exclude=vendor --verbose
|
run: vendor/bin/phplint --no-cache --no-progress --exclude=vendor --verbose
|
||||||
- name: PHP CS Fixer
|
- name: PHP CS Fixer
|
||||||
run: vendor/bin/php-cs-fixer fix --dry-run --verbose --diff .
|
run: vendor/bin/php-cs-fixer check --using-cache=no --diff --verbose .
|
||||||
- run: echo "🍏 This job's status is ${{ job.status }}."
|
- run: echo "🍏 This job's status is ${{ job.status }}."
|
||||||
|
|
||||||
|
|
|
@ -16,9 +16,9 @@ function hook_clickat_render_linklist($data)
|
||||||
'/([^\S]+)@([\w]+)@([\w_\-\.]+)/' => '\1<a href="https://\3/@\2">@\2</a>',
|
'/([^\S]+)@([\w]+)@([\w_\-\.]+)/' => '\1<a href="https://\3/@\2">@\2</a>',
|
||||||
'/([^\S]+)@([\w]+)/' => '\1<a href="https://x.com/\2">@\2</a>'
|
'/([^\S]+)@([\w]+)/' => '\1<a href="https://x.com/\2">@\2</a>'
|
||||||
);
|
);
|
||||||
foreach ($data['links'] as &$value) {
|
foreach ($data['links'] as &value) {
|
||||||
if (strpos($value['description'], '@') !== false) {
|
if (strpos($value['description'], '@') !== false) {
|
||||||
foreach($patterns as $nic => $link) {
|
foreach ($patterns as $nic => $link) {
|
||||||
$value['description'] = preg_replace($nic, $link, $value['description']);
|
$value['description'] = preg_replace($nic, $link, $value['description']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue