/** * test custom markdown extensions * * @dataProvider providerNxCode */ public function testNxCode($input, $expectedOutput) { $output = NxCodeHelper::spoilerTags($input); $this->assertEquals($output, $expectedOutput); }
/** * @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); } }