diff --git a/resources/views/sections/edit-mailable-template.blade.php b/resources/views/sections/edit-mailable-template.blade.php
index 6ca8bba..0115043 100644
--- a/resources/views/sections/edit-mailable-template.blade.php
+++ b/resources/views/sections/edit-mailable-template.blade.php
@@ -341,10 +341,14 @@ className: "fa fa-eye no-disable",
placeholder: "Write your Beautiful Email",
previewRender: function(plainText, preview) {
$.ajax({
- method: "POST",
- url: "{{ route('previewMarkdownView') }}",
- data: { markdown: plainText, namespace: '{{ addslashes($templateData['namespace']) }}', viewdata: "{{ preg_replace("/\r\n/","
", serialize($templateData['view_data'])) }}", name: '{{ $name }}' }
-
+ method: "POST",
+ url: "{{ route('previewMarkdownView') }}",
+ data: {
+ markdown: plainText,
+ namespace: '{{ addslashes($templateData['namespace']) }}',
+ viewdata: "{{ preg_replace("/[\r\n]/","
", serialize($templateData['view_data'])) }}",
+ name: '{{ $name }}'
+ }
}).done(function( HtmledTemplate ) {
preview.innerHTML = HtmledTemplate;
});
@@ -496,7 +500,7 @@ function viewMarkdownParser(plainText){
data: {
markdown: plainText,
namespace: '{{ addslashes($templateData['namespace']) }}',
- viewdata: "{{ preg_replace("/\r\n/","
", serialize($templateData['view_data'])) }}",
+ viewdata: "{{ preg_replace("/[\r\n]/","
", serialize($templateData['view_data'])) }}",
name: '{{ $name }}'
}
diff --git a/src/MailEclipse.php b/src/MailEclipse.php
index 0244bc4..0b1ba03 100644
--- a/src/MailEclipse.php
+++ b/src/MailEclipse.php
@@ -654,12 +654,12 @@ private static function getMissingParams($arg, $params)
}
$type = version_compare(phpversion(), '7.1', '>=')
- ? self::TYPES[$reflection->getName()]
- : self::TYPES[/** @scrutinizer ignore-deprecated */ $reflection->__toString()];
+ ? $reflection->getName()
+ : /** @scrutinizer ignore-deprecated */ $reflection->__toString();
- return is_null($type)
- ? new Mocked($arg, \ReeceM\Mocker\Utils\VarStore::singleton())
- : $type;
+ return array_key_exists($type, self::TYPES)
+ ? self::TYPES[$type]
+ : new Mocked($arg, \ReeceM\Mocker\Utils\VarStore::singleton());
} catch (\Exception $e) {
return $arg;
}