markdown test

detailed tests for emoji, markdown, codes

emoji

:) :( :'(

:laughing: :flushed: :stuck_out_tongue_closed_eyes:

code lines

javascript

var s = "JavaScript syntax highlighting";
import {x, y} as p from 'point';
const ANSWER = 42;

class Car extends Vehicle {
  constructor(speed, cost) {
    super(speed);

    var c = Symbol('cost');
    this[c] = cost;

    this.intro = `This is a car runs at
      ${speed}.`;
  }
}

for (let num of [1, 2, 3]) {
    /* handle exception */
    var e4x =
        <div>Example
            <p>1234</p></div>;
  console.log(num + 0b111110111);
}

bash

cd ~
cp a.php b.php
echo "hello world"

php

<?php namespace App;

use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;

class Article extends Model {

    protected $fillable=['title','body','published_at','user_id'];
    protected $dates=['published_at'];

    public function setPublishedAtAttribute($date){
        // $this->attributes['published_at']=Carbon::createFromFormat('Y-m-d',$date);
        $this->attributes['published_at']=Carbon::parse($date);
    }

    public function getPublishedAtAttribute($date){
        // return (new Carbon($date))->format('Y-m-d');
        return Carbon::parse($date)->format('Y-m-d');
    }

    public function scopePublished($query){
        $query->where('published_at','<=',Carbon::now());
    }

    public function scopeUnpublished($query){
        $query->where('published_at','>',Carbon::now());
    }

    public function user()
    {
        return $this->belongsTo('App\User');
    }

    public function tags()
    {
        return $this->belongsToMany('App\Tag')->withTimestamps();
    }

    public function getTagListAttribute()
    {
        return $this->tags->lists('id');
    }   

}

python

euler019 solution

#Counting Sundays
def leap(y):
    if y%100==0:
        if y%400==0:
            return True
        else:
            return False
    else:
        if y%4==0:
            return True
        else:
            return False

def d(y,m):#how many days for this month
    if m==4 or m==6 or m==9 or m==11:
        return 30
    elif m==2:
        if leap(y):
            return 29
        else:
            return 28
    else:
        return 31

Day=[[] for _ in range(101)]
for i in range(101):
    Day[i]=[0,0,0,0,0,0,0,0,0,0,0,0]
#0 for sunday, 1 for monday, etc.     
#print Day

num=0      
for y in range(1900, 2001):    
#for y in range(1900, 1921):
    for m in range(1,13):

        if y==1900 and m==1: #january 1       
            Day[y-1900][m-1]=1
        else:
            if m==1: #january 1
                Day[y-1900][0]=(d(y-1,12)+Day[y-1901][11])%7
            else:
                Day[y-1900][m-1]=(d(y,m-1)+Day[y-1900][m-2])%7
        print 'y=',y, ' m=', m, ' Day[y-1990][m-1]=',Day[y-1900][m-1]      
        if y>=1901 and Day[y-1900][m-1]==0:
            num+=1
print num  
require 'redcarpet'
markdown = Redcarpet.new("Hello World!")
puts markdown.to_html

This is a normal paragraph:

This is a code block.

<div class="footer">
    © 2004 Foo Corporation
</div>

markdown

block elements

paragraph

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Delectus atque, quisquam eius accusamus praesentium quidem corporis veniam dignissimos dolorum, culpa fugit hic molestiae reprehenderit numquam fuga consectetur non, earum eum amet laborum facilis! Atque, doloribus, vitae! Qui, unde, ut? Dolorum aliquid, aperiam corporis odio dolore repudiandae accusamus. Soluta, illo, quis!

Lorem ipsum dolor sit amet, consectetur adipisicing elit.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Delectus atque, quisquam eius accusamus praesentium quidem corporis veniam dignissimos dolorum, culpa fugit hic molestiae reprehenderit numquam fuga consectetur non, earum eum amet laborum facilis!

blockquotes

Don't walk behind me; I may not lead. Don't walk in front of me; I may not follow.

Just walk beside me and be my friend.

-- Albert Camus

nested blockquotes

This is the first level of quoting.

This is nested blockquote.

Back to the first level.

blockquotes with other elements within

This is a header.

  1. This is the first list item.

    is a country in

  2. This is the second list item.

    Lorem ipsum dolor sit amet, consectetur adipisicing elit.

Here's some example code:

return shell_exec("echo $input | $markdown_script");

lists

ordered lists

  1. consectetur adipisicing

    is a country in consectetur adipisicing elit. Voluptatem mollitia

  2. YES

    is a federal constitutional consectetur adipisicing elit. Voluptatem mollitia

    Lorem ipsum dolor sit amet, consectetur adipisicing elit.

unordered lists

  • item a

    is a country in consectetur adipisicing elit. Voluptatem mollitia

  • item b

    is a federal constitutional consectetur adipisicing elit. Voluptatem mollitia

  • item c

    Lorem ipsum dolor sit amet, consectetur adipisicing elit.

horizontal lines

hr


span elements

links

Lorem ipsum dolor sit amet, consectetur adipisicing elit. To Blog.

http://example.com

Visit GitHub!

Mistaken text.

emphasis

MAKE ME EM

MAKE ME STRONG

symbol literals

* # - ` + - * \ _

inline codes

some code herecd ~ in-between.

images

an image here:

file

other tests

tables

First Second
Foo Bar
OK Nice
First Header Second Header
Content Cell Content Cell
Content Cell Content Cell
Name Description
Help Display the help window.
Close Closes a window

forms