无论出于何种原因,日落(更具体地说是Snudown,它的一个分支)似乎不输出如下行:
> some text
Run Code Online (Sandbox Code Playgroud)
作为HTML中的blockquotes,就像它应该的那样,因为它是有效的Markdown.我知道日落中有扩展允许某些功能,但我找不到引号.
这是我正在使用的代码(它在Objective-C中,但在大多数情况下它是C):
struct sd_callbacks callbacks;
struct html_renderopt options;
const char *rawMarkdown = [markdownString cStringUsingEncoding:NSUTF8StringEncoding];
struct buf *inputBuffer = bufnew(strlen(rawMarkdown));
bufputs(inputBuffer, rawMarkdown);
// Parse the Markdown
struct buf *outputBuffer = bufnew(64);
sdhtml_renderer(&callbacks, &options, 0);
unsigned int extensions = MKDEXT_NO_INTRA_EMPHASIS|MKDEXT_TABLES|MKDEXT_FENCED_CODE|MKDEXT_AUTOLINK|MKDEXT_STRIKETHROUGH|MKDEXT_SUPERSCRIPT|MKDEXT_LAX_SPACING;
struct sd_markdown *markdown = sd_markdown_new(extensions, 16, 4, &callbacks, &options);
sd_markdown_render(outputBuffer, inputBuffer->data, inputBuffer->size, markdown);
sd_markdown_free(markdown);
NSString *HTML = [NSString stringWithCString:bufcstr(outputBuffer) encoding:NSUTF8StringEncoding];
bufrelease(inputBuffer);
bufrelease(outputBuffer);
NSLog(@"%@", HTML);
Run Code Online (Sandbox Code Playgroud)
如果示例项目有助于显示问题,请说明一下.
我的工作中,我要显示随机任意给定的结果数猜想的一个项目,我有六个<html>形象的标签,我只想随机显示3次,以我们每次刷新页面,它显示随机任意三个图像出任何六个
我正在使用html代码作为示例
<html>
<body>
<div class=1>
<a href="http://example1.com">
<div>
<img src="image1.jpg">
</div>
</a>
</div>
<div class=1>
<a href="http://example2.com">
<div>
<img src="image2.jpg">
</div>
</a>
</div>
<div class=1>
<a href="http://example3.com">
<div>
<img src="image3.jpg">
</div>
</a>
</div>
<div class=1>
<a href="http://example4.com">
<div>
<img src="image4.jpg">
</div>
</a>
</div>
<div class=1>
<a href="http://example5.com">
<div>
<img src="image5.jpg">
</div>
</a>
</div>
<div class=1>
<a href="http://example6.com">
<div>
<img src="image6.jpg">
</div>
</a>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
在这六张图片中我只想通过php显示任何三张图片.有可能,我该怎么做?希望你能找到更好的解决方案.此外,我想显示其他标签,如链接在图像和一些更多的标签,以便我可以通过CSS更好地显示图像,所以我认为它可以通过switch语句更容易完成
我知道单行(// ....)注释Ctrl + K + C和取消注释有键盘快捷键Ctrl + K + U.
我的问题是,是否有任何默认的键盘快捷键(/*......*/)注释和取消注释?如果有,怎么样?
如果没有定义默认块注释键盘快捷键,那么 有没有办法为此添加自己的键盘快捷键?我怎么做?
我发现很多关于评论的问题,但是没有找到任何关于块评论的说法.任何帮助表示赞赏:)
我有一个下拉输入选择"评估测试类型",根据选择,某些数据会在其下方显示一个提交按钮.现在我添加到:"评估测试类型"默认值<option selected='selected'></option>但是我想阻止提交按钮出现,如果选择此选项并单击submit1
$options = '';
$filter=mysql_query("select afnumber from employees WHERE Status='Employed'");
while($row = mysql_fetch_array($filter)) {
$options .="<option >" . $row['afnumber'] . "</option>";
}
$menu="<form id='filter' name='filter' method='post' action=''>
AFNumber : <select name='SelectAF' id='filter' style='color:grey;'>" . $options . "</select>
Evaluation Test Type : <select name='Type' id='type' style='color:grey;'><option selected='selected'></option><option value='loyalty'>Loyalty</option><option value='performance'>Performance</option></select>
<input type='submit' name='submit1' value='Submit' style='width:80px; height:30px; text-align:center; padding:0px;'>
</form>
<br>
";
echo $menu;
if(isset($_POST['submit1']))
{
$type = $_POST['Type'];
$mysqli = new mysqli("localhost", "root", "Js", "jr");
/* check connection */ …Run Code Online (Sandbox Code Playgroud) 如何将具有层次结构自引用模型、树集合的集合展平为单维集合。我有一个有父母和孩子的自引用模型。
我希望结果返回一个雄辩的集合,而不是一个简单的集合或数组。数组已用作结果结果以方便演示
关系是这样声明的。
public function parent()
{
return $this->belongsTo(self::class, 'parent_id');
}
public function parentRecursive()
{
return $this->parent()->with('parentRecursive');
}
public function children()
{
return $this->hasMany(self::class, 'parent_id');
}
public function childrenRecursive()
{
return $this->children()->with('childrenRecursive');
}
Run Code Online (Sandbox Code Playgroud)
所以当我调用model->childrenRecursive它时,它会按原样返回集合。像这样。我对其进行了更改toArray()以使其易于阅读。
array:1 [
0 => array:6 [
"id" => 5
"name" => "I am a child of 1"
"parent_id" => "1"
"created_at" => "2016-12-26 13:53:50"
"updated_at" => "2016-12-26 13:53:50"
"children_recursive" => array:1 [
0 => array:6 [
"id" => 6
"name" => "I …Run Code Online (Sandbox Code Playgroud) 我想限制某人可以在我的函数调用中分配给变量的值。例如说我的功能是
function myFunction ($carType, $isOld , $something)
{
//do what is required
}
Run Code Online (Sandbox Code Playgroud)
我希望我应该能够限制 $carType, $isOld 仅具有某些值,例如来自给定数组的值:
$carTypeValues = array ("car1", "car2", "car3");
$isOldValues = array (true,false);
Run Code Online (Sandbox Code Playgroud)
我知道我可以将参数变量限制为某种类类型。
我试图找到一种方法来做到这一点,但我找不到任何能完全满足我想要的东西。我知道一旦实际执行函数调用我就可以检查该值,但是我正在寻找一些允许用户最好能够使用选择器的东西,例如:
myFunction (carType::car1, isOld::car2 , $something);
Run Code Online (Sandbox Code Playgroud)
我不确定,这可能是:
myFunction (carType.car1, isOld.car2 , $something);
Run Code Online (Sandbox Code Playgroud)
感谢您阅读本文
我想知道如何从选择框中选择多个选项,如下所示:
<label for="color">Colors</label>
<select class="inputbox" name="color" id="color" style="width:180px;">
<option value="Black">Black</option>
<option value="White">White</option>
<option value="Tan">Tan</option>
<option value="Navy">Navy</option>
<option value="RoyalBlue">Royal Blue</option>
<option value="Red">Red</option>
<option value="Yellow">Yellow</option>
<option value="Hunter(DarkGreen)">Hunter(Dark Green)</option>
<option value="Kelly(Green)">Kelly(Green)</option>
<option value="Burgundy">Burgundy</option>
</select>
Run Code Online (Sandbox Code Playgroud)
谢谢
我想知道如何进行拖放图像上传。我不明白的是如何让服务器知道用户何时将图像放入某个 div 或上传到正文?是否支持所有常见的浏览器,即,ff,chrome,safari。谢谢你 :)
为什么它没有以给定的方式呈现?除了 AccessDeniedHttpException 之外,其他类型的异常都运行良好
应用程序/异常/Handler.php
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException as AccessDeniedHttpException;
...
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $exception)
...
// 403 Forbidden
if ($exception instanceof AccessDeniedHttpException)
{
return response()->json([
'code' => 403,
'message' => 'This action is unauthorized1.',
],403);
}
// 401 Unauthorized
if ($exception instanceof AuthenticationException)
{
return response()->json([
'code' => 401,
'message' => 'Unauthenticated error.',
], 401);
}
Run Code Online (Sandbox Code Playgroud)
401 就像一个魅力,但 …
我知道我能做到这一点并且有效
string Dob; //string
Console.WriteLine("Enter date of Birth in format DD/MM/YYYY: ");
Dob = Console.ReadLine();
Run Code Online (Sandbox Code Playgroud)
但我想要这样的东西!预定义的方法或短路方式
DateTime Dob; //DateTime
Console.WriteLine("Enter date of Birth in format DD/MM/YYYY: ");
//What i am expecting, but is not possible as its DateTime
Dob = Console.ReadLine(); // expects a string
Run Code Online (Sandbox Code Playgroud)
是否有一种特定的方法可以直接从键盘获取Dob变量的日期.
在DateTime类中是否有预定义的方法?实现这一目标的最佳途径或最短途径是什么?