pse*_*ert 22 iframe openstreetmap github-flavored-markdown
从 openstreetmap 页面上的共享选项卡,我可以将地图视图导出为 HTML,例如:
<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://www.openstreetmap.org/export/embed.html?bbox=6.047544479370118%2C46.23053702499607%2C6.061706542968751%2C46.23821801159735&layer=mapnik" style="border: 1px solid black"></iframe>
<br/><small><a href="https://www.openstreetmap.org/#map=17/46.23438/6.05463">View Larger Map</a></small>
Run Code Online (Sandbox Code Playgroud)
我想将它嵌入到 github 上的 README.md 页面中,例如
环顾四周,最接近iframe在 markdown 中嵌入s 的是git lab guide。随后我尝试了<figure class="video_container">标签,但在 gitlab 或 github 上都看不到它。
# how to find us?
we will be here:
<figure class="video_container">
<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://www.openstreetmap.org/export/embed.html?bbox=6.047544479370118%2C46.23053702499607%2C6.061706542968751%2C46.23821801159735&layer=mapnik" style="border: 1px solid black"></iframe>
</figure>
Run Code Online (Sandbox Code Playgroud)
我是否遗漏了一些东西,或者这更好地留给真正的 HTML 而不是降价可以/应该做什么?
mar*_*tin 25
不支持将嵌入<iframe>到 GitHub 风格的 Markdown (GFM) 中。这是他们规范中的官方立场:
6.11 不允许的原始 HTML(扩展)
GFM 启用 tagfilter 扩展,在呈现 HTML 输出时将过滤以下 HTML 标签:
<title><textarea><style><xmp><iframe><noembed><noframes><script><plaintext>[...] 这些标签是特别选择的,因为它们以独特的方式改变了 HTML 的解释方式 [...],这在其他呈现的 Markdown 内容的上下文中通常是不可取的。
所有其他 HTML 标签保持不变。
与其他答案中提到的视频解决方案类似,您可以嵌入地图的屏幕截图,并将其设为指向OSM 地图部分 URL 的链接:
| 归档时间: |
|
| 查看次数: |
13213 次 |
| 最近记录: |