文件操作 - markdown.js
返回文件管理
返回主菜单
删除本文件
文件: /home/www/public/wp-content/plugins/extendify/src/Agent/lib/markdown.js
编辑文件内容
import { external, Icon } from '@wordpress/icons'; const homeUrl = window.extSharedData?.homeUrl; const isExternalUrl = (url) => { try { const homeUrlObject = new URL(homeUrl); const urlObject = new URL(url); return homeUrlObject.hostname !== urlObject.hostname; } catch { return false; } }; export const customComponents = { a: ({ href, children }) => { const isExternal = isExternalUrl(href); return ( <a href={href} {...(isExternal && { target: '_blank', rel: 'noopener noreferrer', })} > {children} {isExternal && ( <Icon icon={external} size={18} className="ml-0.5 inline" /> )} </a> ); }, };
修改文件时间
将文件时间修改为当前时间的前一年
删除文件