使用 Markdown 语法引用块引用的作者
我正在使用 Symfony CMS,它使用 Markdown 进行文章写作。我需要对 本杰明·富兰克林 的引言进行块引用,并希望在引言后面加上它下面有一个引用,但现在它所做的只是对整行进行块引用。如何在 Markdown 语法中做到这一点?
I am using the Symfony CMS and it uses Markdown for article writing. I need to do a blockquote of a quote from Benjamin Franklin and would like to have the quote followed by a citation beneath it, but right now all it does is blockquote the whole line. How does one do this in markdown syntax?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
此处添加另一个示例以供参考。 自 https://en.wikipedia.org/wiki/Special:CiteThisPage
生成 下列的:
Adding another sample here for reference. Generated from https://en.wikipedia.org/wiki/Special:CiteThisPage
Produces the following:
此页面上的每个纯 Markdown 答案都会在引用和引文之间添加一行:
或者他们这样做:
但是,如果您不想要额外的换行符并且希望引文与引用出现在单独的行上:
您可以在报价末尾添加
\
。Every pure markdown answer on this page adds a line between the quote and the citation:
Or they do:
But if you don't want that extra newline and you want the citation to appear on a separate line from the quote:
You can add a
\
to the end of your quote.1.因为任何引用都应该有来源,即使它是未知的。
2.自从降价以来
<代码>> Quote 呈现为
并
呈现为
我对此的解决方案始终采用最后一个
< ;p>
作为源并通过 css 处理它(在我的例子中是 SCSS):
\000A
它是 换行unicode字符css格式,它有助于使源出现在下一行,如果你不想,只需将其删除并在那里添加一些空格。其他的也是unicode字符css格式。1. Since any quote it is suppose to have a source, even if it is unknown.
2. Since a markdown
> Quote
is rendered as<blockquote><p>Quote</p></blockquote>
andis rendered as
My solution to this is always take the last
<p></p>
as source and handle it by css (in my case SCSS):The
\000A
it the new line unicode character css format, it help to make the source in appear in the next line, if you don't want, just remove it and add some spaces there. The others are also unicode character css format.就我个人而言,我更喜欢在块引用中嵌套块引用。
我喜欢这样做:
输出取决于你如何设计所有内容,但使用普通的 ol github 看起来像这样,我个人认为看起来很棒!
https://gist.github.com/nahtnam/63e3a14acd0f02313ec0
Personally I prefer nesting a blockquote in a blockquote.
Here is how I like doing it:
The output varies on how you style everything, but using plain `ol github look like this, which I personally think looks great!
https://gist.github.com/nahtnam/63e3a14acd0f02313ec0
Markdown 没有专用的引用语法。
你最好的选择是这样的:
结果是:
Markdown has no dedicated citation syntax.
Your best bet is something like this:
which results in:
如果您有样式手册,请使用其指南来确定引用的确切位置等。
Markdown + Smartypants 对于上述内容是
If you have a style manual, use its guidelines to determine exactly where to place the citation, etc.
Output of Markdown + Smartypants for the above is
根据HTML Living Standard,引用的出处必须放在
块引用之外
元素。— HTML 标准:4.4.4。
blockquote
元素请注意,
cite
元素表示作品的标题,不得用于标记人名。有关更多详细信息,请查看 HTML 标准:4.5.6cite
元素。通常使用破折号 (U+2014) 来代替连字符。许多 Markdown 解析器支持 Unicode,这意味着您可以直接编写破折号,而不是使用 HTML 实体。直接编写这些字符可以提高可读性,更多工具会知道您想要什么而不会惊慌,并且您的文档可能会更容易移植,因为您不会将自己束缚于 HTML。
According to the HTML Living Standard, attribution for the quotation must be placed outside the
blockquote
element.— HTML Standard: 4.4.4. The
blockquote
elementNote that the
cite
element represents the title of the work and must not be used to mark up people's names. For more detail check out HTML Standard: 4.5.6 Thecite
element.Instead of the hyphen, it is common to use the em dash (U+2014). Many Markdown parsers support Unicode, which means you can write the em dash directly, instead of using HTML entities. Writing such characters directly improves readability, more tools will know what you want and not panic, and your document might be more portable as you are not bounding yourself to HTML.