update editorjs code block view

This commit is contained in:
Simon Vieille 2022-03-26 16:40:09 +01:00
parent d6a05fb3a3
commit 0dc6d3db27
3 changed files with 53 additions and 3 deletions

View file

@ -4,3 +4,50 @@
.CodeMirror-fullscreen, .editor-toolbar.fullscreen {
z-index: 2000;
}
.ejs-link {
margin: 10px auto;
max-width: 80%;
border: 2px solid #333;
border-radius: 5px;
&--anchor {
display: block;
padding: 30px;
}
&-content {
display: inline-block;
vertical-align: top;
&--title {
font-weight: bold;
}
&--description {
font-size: 15px;
}
&--link {
padding-top: 10px;
font-size: 14px;
line-height: 20px;
}
}
$image-size: 85px;
&--anchor--with-image &-content {
width: calc(100% - $image-size - 5px);
padding-right: 25px;
}
&--image {
display: inline-block;
width: $image-size;
height: $image-size;
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
}
}

View file

@ -71,6 +71,7 @@ core:
editor_js:
blocks:
link: 'editorjs/link.html.twig'
code: 'editorjs/code.html.twig'
file_manager:
mimes:

View file

@ -71,9 +71,11 @@
<div class="font-weight-bold pb-2">Contenu</div>
{% if entity.contentFormat == 'html' %}
{{ entity.content|raw|nl2br }}
{% else %}
{{ entity.content|markdown('post') }}
{{- entity.content|murph_url|file_attributes|post -}}
{% elseif entity.contentFormat == 'markdown' %}
{{- entity.content|murph_url|file_attributes|markdown('post') -}}
{% elseif entity.contentFormat == 'editorjs' %}
{{- entity.content|murph_url|file_attributes|editorjs_to_html|raw -}}
{% endif %}
{% if entity.notebook %}