截图附带网页标题和链接发送到思源笔记

功能建议 · 212 次浏览
捏见影 创建于 2024-03-06 21:34

请问如何修改“自定义窗口:Note”中的辅助C#代码才能将

![](assets/ScreenShot/x.jpg)

变成这样:

![url](assets/ScreenShot/x.jpg “url_title”)

 

对着这段代码摸索了好久,依然不会传入参数,想哭

public static string AssetsFileLink(string assets_path, IDictionary<string, object> dataContext)
{
	var ext_list = dataContext["ext_list"].ToString();
	string assets_link = "";
	string ext = Regex.Match(assets_path, "\\..*?$", RegexOptions.RightToLeft).ToString();
	string assets_name = Regex.Match(assets_path,
	                                 "(?<=/).*?(?=" + ext + ")", RegexOptions.RightToLeft).ToString();
	if (ext_list.Contains(ext))
	{
		assets_link = "!" + "[" + url + "]("+  assets_path + ")";
	} else {
		assets_link = "!" + "[" + assets_name + "](" + assets_path + ")";
	}

	return assets_link;
}
捏见影 最后更新于 2024/3/6

回复内容
暂无回复
回复主贴