是否可以使用 HTML 标记来“强制”BBCode 嵌入具有特定尺寸的图像?

问题描述 投票:0回答:0

我花了很多时间在面向教育/学习的社区中提问和回答问题。最近的论坛使用 Markdown,但仍然有相当多的论坛使用 BBCode 作为他们的标记界面,包括我的学校。

为了避免让自己头疼,我使用降价编辑软件(黑曜石)来写我的问题/答案/回复。 对于目标是 BBCode 论坛的那些时间,我想使用一个 shell 脚本,它将 Markdown 文件作为输入并生成一个 BBCode 版本,将输出保存到我的剪贴板。

以下片段可以是降价文件,我包括我需要的任何媒体(图像或 Gif)以及尺寸:

One thing 1PP (1 Point Perspective) and 2PP (2 Point Perspective) will always have in common are the vertical lines, they are always true verticals:
![500x100](https://i.imgur.com/lTH5gg6.gif)
The above(1PP), the Y-axis of the box are paralell with the red, vertical lines. Its also the same for the below (2PP), the Y-axis of the box are paralell with the red, vertical lines
![500x100](https://i.imgur.com/ObMTgv0.gif)

脚本将简单地解析 Markdown 文件,返回如下输出:

One thing 1PP (1 Point Perspective) and 2PP (2 Point Perspective) will always have in common are the vertical lines, they are always true verticals:
[imgwh=500,100]https://i.imgur.com/lTH5gg6.gif[/imgwh]    
The above(1PP), the Y-axis of the box are paralell with the red, vertical lines. Its also the same for the below (2PP), the Y-axis of the box are paralell with the red, vertical lines:
[imgwh=500,100]https://i.imgur.com/ObMTgv0.gif[/imgwh]   

我已经写了 90% 的 shell 脚本并且运行得很好。我坚持寻找一种一致的方法来调整 BBCode 中的图像大小。经过一些搜索,我了解到用于调整图像大小的标签并不是使用 BBCode 的论坛的标准功能,例如一个论坛支持使用像

[imgwh]
(上面的例子)这样的标签来调整媒体大小,而许多其他论坛不支持,你只能放置图像。

经过进一步搜索,我找到了THIS解决方案,但它并不理想,我真的需要一种能够同时确定宽度和高度的方法,而且我希望避免将尺寸抽象为

S
M
 L

我还尝试使用 FFMPEG/ImageMagick 将媒体大小调整到所需的尺寸,然后再将它们上传到网站。结果是可怕的而且非常慢,特别是对于 gif 文件。我没有快速的电脑,但我有快速的互联网。

是否可以使用 HTML 标记来“强制”BBCode 嵌入具有特定尺寸的图像?我不知道任何 HTML,但如果可能的话,我会学习它。如果没有,那么是否有图像托管网站,您可以在 URL 本身中请求图像的大小,例如:

https://i.imgur.com/lTH5gg6_W500xH100.gif

任何帮助或只是为我指明正确的方向,将不胜感激!

html bbcode
© www.soinside.com 2019 - 2024. All rights reserved.