Why is my property being rendered when I don't call render? I have a string property, and HTML is getting rendered instead of a string, even though I don't call render where the property is being accessed.

Twig template:

{{ attach_library('mymodule/video') }}

{% if content.video_url|render %}
  &lt;video&gt;
    &lt;source src="{{ content.video_url }}" type="video/mp4"&gt;
  &lt;/video&gt;
{% endif %}


As you can see, I'm specifying src="{{ content.video_url }}", NOT src="{{ content.video_url|render }}". Still, the rendered HTML is:

&lt;div&gt;


&lt;video&gt;
  &lt;source src="            &lt;div data-quickedit-field-id=" paragraph="" ex_video_url="" en="" default"="" class="field field--name-video-url field--type-string field--label-hidden field__item"&gt;video.mp4&lt;/video&gt;&lt;/div&gt;" type="video/mp4"&gt;


Why is drupal rendering HTML instead of a string?
content.video_url contains a build array of the field which Twig renders automatically, including the HTML markup of the field template.

To print the raw string value use the entity object which stores the field, node in node.html.twig

{{ node.video_url.value }}


or paragraph in paragraph.html.twig:

{{ paragraph.video_url.value }}