Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Commit

Permalink
Merge pull request #188 from Qoraiche/fix/newline-issue-with-factory-…
Browse files Browse the repository at this point in the history
…data

Fix/newline issue with factory data
  • Loading branch information
ReeceM authored Dec 4, 2021
2 parents 38b38e2 + 00b664d commit 48cabf1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
14 changes: 9 additions & 5 deletions resources/views/sections/edit-mailable-template.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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/","<br />", serialize($templateData['view_data'])) }}", name: '{{ $name }}' }
method: "POST",
url: "{{ route('previewMarkdownView') }}",
data: {
markdown: plainText,
namespace: '{{ addslashes($templateData['namespace']) }}',
viewdata: "{{ preg_replace("/[\r\n]/","<br />", serialize($templateData['view_data'])) }}",
name: '{{ $name }}'
}
}).done(function( HtmledTemplate ) {
preview.innerHTML = HtmledTemplate;
});
Expand Down Expand Up @@ -496,7 +500,7 @@ function viewMarkdownParser(plainText){
data: {
markdown: plainText,
namespace: '{{ addslashes($templateData['namespace']) }}',
viewdata: "{{ preg_replace("/\r\n/","<br />", serialize($templateData['view_data'])) }}",
viewdata: "{{ preg_replace("/[\r\n]/","<br />", serialize($templateData['view_data'])) }}",
name: '{{ $name }}'
}
Expand Down
10 changes: 5 additions & 5 deletions src/MailEclipse.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 48cabf1

Please sign in to comment.