Skip to content

Commit

Permalink
Used new format for mini html link parser
Browse files Browse the repository at this point in the history
  • Loading branch information
Hai Zheng committed Nov 12, 2024
1 parent 9611838 commit da0e8ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/cloud.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ public function update_qc_activation($qc_activated, $quite = false)

/**
* Load QC status for dash usage
* Format to translate: `<a href="{{xxx}}" class="button button-primary">xxxx</a><a href="{{xxx}}">xxxx2</a>`
* Format to translate: `<a href="{#xxx#}" class="button button-primary">xxxx</a><a href="{#xxx#}">xxxx2</a>`
*
* @since 7.0
*/
Expand Down
4 changes: 2 additions & 2 deletions src/str.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
class Str
{
/**
* Translate QC HTML links from html. Convert `<a href="{{xxx}}">xxxx</a>` to `<a href="xxx">xxxx</a>`
* Translate QC HTML links from html. Convert `<a href="{#xxx#}">xxxx</a>` to `<a href="xxx">xxxx</a>`
*
* @since 7.0
*/
public static function translate_qc_apis($html)
{
preg_match_all('/<a href="{{(\w+)}}"/U', $html, $matches);
preg_match_all('/<a href="{#(\w+)#}"/U', $html, $matches);
if (!$matches) return $html;

foreach ($matches[0] as $k => $html_to_be_replaced) {
Expand Down

0 comments on commit da0e8ad

Please sign in to comment.