请教这样添加链接描述 访问的是 https://bilibili.com 不能访问完整的URL链接 有没有办法可以访问到完整链接
[https://bilibili.com][1]
[1]: https://bilibili.com/123
文章链接描述不能添加http吗?
Re: 文章链接描述不能添加http吗?
-------
方式:自动过滤 http(s)://
1. Typecho 版本 v1.2.1
2. 文件 var/Utils/HyperDown.php 第 532~545 行,替换为以下
代码: 全选
$text = preg_replace_callback(
"/\[((?:[^\]]|\\\\\]|\\\\\[)+?)\]\[((?:[^\]]|\\\\\]|\\\\\[)+?)\]/",
function ($matches) {
$escaped = $this->parseInline(
$this->escapeBracket(
preg_replace("/^https?:\/\//", "", $matches[1])
), '', false
);
$url = isset($this->_definitions[$matches[2]]) ? $this->_definitions[$matches[2]] : '';
$result = $url ?
"<a href=\"{$url}\">{$escaped}</a>" :
$escaped;
return $this->makeHolder($result);
},
$text
);
方式:使用 [文本](链接) 格式
方法一:手动输入 []() 格式
方法二:使用以下插件接口在编辑器新增按键,在自定义的 render 里实现插入 []() 格式
代码: 全选
Typecho_Plugin::factory('admin/write-post.php')->bottom = ['PluginFolderName_Plugin', 'render']; // 请将 PluginFolderName 替换为插件的文件夹名称
Typecho_Plugin::factory('admin/write-page.php')->bottom = ['PluginFolderName_Plugin', 'render']; // 请将 PluginFolderName 替换为插件的文件夹名称
Re: 文章链接描述不能添加http吗?
谢谢 。新年快乐Lopwon 写了: ↑2024年 12月 29日 20:00-------
方式:自动过滤 http(s)://
1. Typecho 版本 v1.2.1
2. 文件 var/Utils/HyperDown.php 第 532~545 行,替换为以下
-------代码: 全选
$text = preg_replace_callback( "/\[((?:[^\]]|\\\\\]|\\\\\[)+?)\]\[((?:[^\]]|\\\\\]|\\\\\[)+?)\]/", function ($matches) { $escaped = $this->parseInline( $this->escapeBracket( preg_replace("/^https?:\/\//", "", $matches[1]) ), '', false ); $url = isset($this->_definitions[$matches[2]]) ? $this->_definitions[$matches[2]] : ''; $result = $url ? "<a href=\"{$url}\">{$escaped}</a>" : $escaped; return $this->makeHolder($result); }, $text );
方式:使用 [文本](链接) 格式
方法一:手动输入 []() 格式
方法二:使用以下插件接口在编辑器新增按键,在自定义的 render 里实现插入 []() 格式
代码: 全选
Typecho_Plugin::factory('admin/write-post.php')->bottom = ['PluginFolderName_Plugin', 'render']; // 请将 PluginFolderName 替换为插件的文件夹名称 Typecho_Plugin::factory('admin/write-page.php')->bottom = ['PluginFolderName_Plugin', 'render']; // 请将 PluginFolderName 替换为插件的文件夹名称