无效的减价示例是什么? [英] What's an example of some invalid markdown?

查看:75
本文介绍了无效的减价示例是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为一个具有解释为减价的属性的模型编写单元测试.我想测试一下,如果markdown无效,则该对象无效-但这是一种宽容的语法,到目前为止,我尝试过的一切都证明是有效的markdown!无效的降价示例是什么?

I'm writing unit tests for a model with an attribute that's interpreted as markdown. I'd like to test that if the markdown is invalid, then the object is invalid - but it's such a forgiving syntax that everything I've tried so far turns out to be valid markdown! What's an example of some invalid markdown?

推荐答案

我没有广泛使用markdown,但给我的印象是,不可能只写"invalid" markdown的markdown来做你想做的事情.与之相反,当它不知道要做什么时不会抛出错误,而是将其视为纯文本.

I haven't used markdown extensively but i was under the impression that it is impossible to write "invalid" markdown only markdown that wont do what you want it to. As in instead of throwing an error when it doesn't know what to do it just treats it as plain text.

在另一条路径上,可能可以编写脚本来尝试识别用户可能不想要的内容,例如,如果有人输入了**test*,他们可能打算了*test***test**

On a different path one could probably write a script to try and identify things that the user probably didn't intend, for example if someone entered **test* they probably intended *test* or **test**

这篇关于无效的减价示例是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆