コード例 #1
0
 /**
  * test custom markdown extensions
  *
  * @dataProvider providerNxCode
  */
 public function testNxCode($input, $expectedOutput)
 {
     $output = NxCodeHelper::spoilerTags($input);
     $this->assertEquals($output, $expectedOutput);
 }
コード例 #2
0
 /**
  * @param request
  * @return json - including markdown rendered version of the text field from the request
  */
 public function previewPost(Request $request)
 {
     if (\Request::ajax()) {
         $data = \Input::all();
         $response = array();
         $response['text'] = \Nexus\Helpers\NxCodeHelper::nxDecode($data['text']);
         return \Response::json($response);
     }
 }