mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fix #958
This commit is contained in:
parent
cd42399c29
commit
7e66794cf5
@ -25,6 +25,7 @@ namespace FireflyIII\Support\Twig;
|
|||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use FireflyIII\Models\Account;
|
use FireflyIII\Models\Account;
|
||||||
use FireflyIII\Models\TransactionJournal;
|
use FireflyIII\Models\TransactionJournal;
|
||||||
|
use League\CommonMark\CommonMarkConverter;
|
||||||
use Route;
|
use Route;
|
||||||
use Steam;
|
use Steam;
|
||||||
use Twig_Extension;
|
use Twig_Extension;
|
||||||
@ -45,6 +46,7 @@ class General extends Twig_Extension
|
|||||||
$this->balance(),
|
$this->balance(),
|
||||||
$this->formatFilesize(),
|
$this->formatFilesize(),
|
||||||
$this->mimeIcon(),
|
$this->mimeIcon(),
|
||||||
|
$this->markdown(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,6 +148,21 @@ class General extends Twig_Extension
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Twig_SimpleFilter
|
||||||
|
*/
|
||||||
|
protected function markdown(): Twig_SimpleFilter
|
||||||
|
{
|
||||||
|
return new Twig_SimpleFilter(
|
||||||
|
'markdown',
|
||||||
|
function (string $text): string {
|
||||||
|
$converter = new CommonMarkConverter;
|
||||||
|
|
||||||
|
return $converter->convertToHtml($text);
|
||||||
|
},['is_safe' => ['html']]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Twig_SimpleFilter
|
* @return Twig_SimpleFilter
|
||||||
*/
|
*/
|
||||||
@ -164,6 +181,7 @@ class General extends Twig_Extension
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Twig_SimpleFunction
|
* @return Twig_SimpleFunction
|
||||||
*/
|
*/
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
{% if env('MAPBOX_API_KEY','') == '' %}
|
{% if env('MAPBOX_API_KEY','') == '' %}
|
||||||
<p class="text-danger">
|
<p class="text-danger">
|
||||||
{{ trans('mapbox_api_key')|raw }}
|
{{ trans('firefly.mapbox_api_key')|raw }}
|
||||||
</p>
|
</p>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div id="{{ name }}_map" style="width:100%;height:300px;"></div>
|
<div id="{{ name }}_map" style="width:100%;height:300px;"></div>
|
||||||
|
@ -130,7 +130,7 @@
|
|||||||
{% if not rule.active %}
|
{% if not rule.active %}
|
||||||
class="text-muted"
|
class="text-muted"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
><br/>{{ rule.description }}</small>
|
><br/>{{ rule.description|markdown }}</small>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
<h3 class="box-title">{{ 'optionalFields'|_ }}</h3>
|
<h3 class="box-title">{{ 'optionalFields'|_ }}</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
{{ ExpandedForm.textarea('description') }}
|
{{ ExpandedForm.textarea('description', null, {helpText: trans('firefly.field_supports_markdown')}) }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
<h3 class="box-title">{{ 'optionalFields'|_ }}</h3>
|
<h3 class="box-title">{{ 'optionalFields'|_ }}</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
{{ ExpandedForm.textarea('description') }}
|
{{ ExpandedForm.textarea('description', null, {helpText: trans('firefly.field_supports_markdown')}) }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user