SEO Anseo Articles

Automatically adding "raw" tags to your code in Hubspot

Written by Barry Grennan | Aug 26, 2024 3:00:00 PM
This will be fairly niche. I'm mostly publishing it to impress Stephanie.

It's been a constant frustration when writing about hubl that every time you need to mention a variable ( {{ variable }} ), tag ( {% tag %} ), or any other element within a hubl delimiter, it must be manually enclosed in "raw" tags.


When my code is wrapped in raw tags you can see it like this:

SEO Anseo Articles
 
If I forget to wrap the code in raw tags it will show like this:
 
SEO Anseo Articles

It get's very tedious wrapping each piece of code in these because hubl is basically all we write about.

So every time we include a piece of hubl code that is intended to be visible in the article it needs to start with <raw> and end with <endraw>

To work around this I've placed some filters on my blog template.



 

This will be fairly niche. I'm mostly publishing it to impress Stephanie.

It's been a constant frustration when writing about hubl that every time you need to mention a variable ( {{ variable }} ), tag ( {% tag %} ), or any other element within a hubl delimiter, it must be manually enclosed in "raw" tags.


When my code is wrapped in raw tags you can see it like this:

SEO Anseo Articles
 
If I forget to wrap the code in raw tags it will show like this:
 
SEO Anseo Articles

It get's very tedious wrapping each piece of code in these because hubl is basically all we write about.

So every time we include a piece of hubl code that is intended to be visible in the article it needs to start with <raw> and end with <endraw>

To work around this I've placed some filters on my blog template.



 

This will be fairly niche. I'm mostly publishing it to impress Stephanie.

It's been a constant frustration when writing about hubl that every time you need to mention a variable ( {{ variable }} ), tag ( {% tag %} ), or any other element within a hubl delimiter, it must be manually enclosed in "raw" tags.


When my code is wrapped in raw tags you can see it like this:

SEO Anseo Articles
 
If I forget to wrap the code in raw tags it will show like this:
 
SEO Anseo Articles

It get's very tedious wrapping each piece of code in these because hubl is basically all we write about.

So every time we include a piece of hubl code that is intended to be visible in the article it needs to start with <raw> and end with <endraw>

To work around this I've placed some filters on my blog template.



 

This will be fairly niche. I'm mostly publishing it to impress Stephanie.

It's been a constant frustration when writing about hubl that every time you need to mention a variable ( {{ variable }} ), tag ( {% tag %} ), or any other element within a hubl delimiter, it must be manually enclosed in "raw" tags.


When my code is wrapped in raw tags you can see it like this:

SEO Anseo Articles
 
If I forget to wrap the code in raw tags it will show like this:
 
SEO Anseo Articles

It get's very tedious wrapping each piece of code in these because hubl is basically all we write about.

So every time we include a piece of hubl code that is intended to be visible in the article it needs to start with <raw> and end with <endraw>

To work around this I've placed some filters on my blog template.



 

This will be fairly niche. I'm mostly publishing it to impress Stephanie.

It's been a constant frustration when writing about hubl that every time you need to mention a variable ( {{ variable }} ), tag ( {% tag %} ), or any other element within a hubl delimiter, it must be manually enclosed in "raw" tags.


When my code is wrapped in raw tags you can see it like this:

SEO Anseo Articles
 
If I forget to wrap the code in raw tags it will show like this:
 
SEO Anseo Articles

It get's very tedious wrapping each piece of code in these because hubl is basically all we write about.

So every time we include a piece of hubl code that is intended to be visible in the article it needs to start with <raw> and end with <endraw>

To work around this I've placed some filters on my blog template.



 

This will be fairly niche. I'm mostly publishing it to impress Stephanie.

It's been a constant frustration when writing about hubl that every time you need to mention a variable ( {{ variable }} ), tag ( {% tag %} ), or any other element within a hubl delimiter, it must be manually enclosed in "raw" tags.


When my code is wrapped in raw tags you can see it like this:

SEO Anseo Articles
 
If I forget to wrap the code in raw tags it will show like this:
 
SEO Anseo Articles

It get's very tedious wrapping each piece of code in these because hubl is basically all we write about.

So every time we include a piece of hubl code that is intended to be visible in the article it needs to start with <raw> and end with <endraw>

To work around this I've placed some filters on my blog template.



 

This will be fairly niche. I'm mostly publishing it to impress Stephanie.

It's been a constant frustration when writing about hubl that every time you need to mention a variable ( {{ variable }} ), tag ( {% tag %} ), or any other element within a hubl delimiter, it must be manually enclosed in "raw" tags.


When my code is wrapped in raw tags you can see it like this:

SEO Anseo Articles
 
If I forget to wrap the code in raw tags it will show like this:
 
SEO Anseo Articles

It get's very tedious wrapping each piece of code in these because hubl is basically all we write about.

So every time we include a piece of hubl code that is intended to be visible in the article it needs to start with <raw> and end with <endraw>

To work around this I've placed some filters on my blog template.



 

This will be fairly niche. I'm mostly publishing it to impress Stephanie.

It's been a constant frustration when writing about hubl that every time you need to mention a variable ( {{ variable }} ), tag ( {% tag %} ), or any other element within a hubl delimiter, it must be manually enclosed in "raw" tags.


When my code is wrapped in raw tags you can see it like this:

SEO Anseo Articles
 
If I forget to wrap the code in raw tags it will show like this:
 
SEO Anseo Articles

It get's very tedious wrapping each piece of code in these because hubl is basically all we write about.

So every time we include a piece of hubl code that is intended to be visible in the article it needs to start with <raw> and end with <endraw>

To work around this I've placed some filters on my blog template.



 

This will be fairly niche. I'm mostly publishing it to impress Stephanie.

It's been a constant frustration when writing about hubl that every time you need to mention a variable ( {{ variable }} ), tag ( {% tag %} ), or any other element within a hubl delimiter, it must be manually enclosed in "raw" tags.


When my code is wrapped in raw tags you can see it like this:

SEO Anseo Articles
 
If I forget to wrap the code in raw tags it will show like this:
 
SEO Anseo Articles

It get's very tedious wrapping each piece of code in these because hubl is basically all we write about.

So every time we include a piece of hubl code that is intended to be visible in the article it needs to start with <raw> and end with <endraw>

To work around this I've placed some filters on my blog template.



 

This will be fairly niche. I'm mostly publishing it to impress Stephanie.

It's been a constant frustration when writing about hubl that every time you need to mention a variable ( {{ variable }} ), tag ( {% tag %} ), or any other element within a hubl delimiter, it must be manually enclosed in "raw" tags.


When my code is wrapped in raw tags you can see it like this:

SEO Anseo Articles
 
If I forget to wrap the code in raw tags it will show like this:
 
SEO Anseo Articles

It get's very tedious wrapping each piece of code in these because hubl is basically all we write about.

So every time we include a piece of hubl code that is intended to be visible in the article it needs to start with <raw> and end with <endraw>

To work around this I've placed some filters on my blog template.



 

This will be fairly niche. I'm mostly publishing it to impress Stephanie.

It's been a constant frustration when writing about hubl that every time you need to mention a variable ( {{ variable }} ), tag ( {% tag %} ), or any other element within a hubl delimiter, it must be manually enclosed in "raw" tags.


When my code is wrapped in raw tags you can see it like this:

SEO Anseo Articles
 
If I forget to wrap the code in raw tags it will show like this:
 
SEO Anseo Articles

It get's very tedious wrapping each piece of code in these because hubl is basically all we write about.

So every time we include a piece of hubl code that is intended to be visible in the article it needs to start with <raw> and end with <endraw>

To work around this I've placed some filters on my blog template.



 

This will be fairly niche. I'm mostly publishing it to impress Stephanie.

It's been a constant frustration when writing about hubl that every time you need to mention a variable ( {{ variable }} ), tag ( {% tag %} ), or any other element within a hubl delimiter, it must be manually enclosed in "raw" tags.


When my code is wrapped in raw tags you can see it like this:

SEO Anseo Articles
 
If I forget to wrap the code in raw tags it will show like this:
 
SEO Anseo Articles

It get's very tedious wrapping each piece of code in these because hubl is basically all we write about.

So every time we include a piece of hubl code that is intended to be visible in the article it needs to start with <raw> and end with <endraw>

To work around this I've placed some filters on my blog template.



 

{%- set hs_blog_post_body -%} {%- set in_blog_post_body = true -%}
This will be fairly niche. I'm mostly publishing it to impress Stephanie.

It's been a constant frustration when writing about hubl that every time you need to mention a variable ({% raw %} {{ variable }} {% endraw %}), tag ({% raw %} {% tag %} {% endraw %}), or any other element within a hubl delimiter, it must be manually enclosed in "raw" tags.


When my code is wrapped in raw tags you can see it like this:

{{ group.name }}
 
If I forget to wrap the code in raw tags it will show like this:
 
{{ group.name }}

It get's very tedious wrapping each piece of code in these because hubl is basically all we write about.

So every time we include a piece of hubl code that is intended to be visible in the article it needs to start with <raw> and end with <endraw>

To work around this I've placed some filters on my blog template.

{% set modified_content = content.post_body|replace('<pre>', '<pre><raw>')|replace('</pre>', '<endraw></pre>') %}

{% if request.postDict.inpageEditorUI %}

{{ content.post_body }}  

{% else %}  

{{ modified_content }}

{% endif %}
 
Using this method, I can then use the <pre> tags which are built into the blog editor to add my code as usual, but now those <pre> tags automatically include raw tags like
<pre><raw><endraw></pre>
 

Nerdy PostScript

Just in case you need to know, to be able to include <raw> and <endraw> in the text of this post I also needed to create some filters for the {% raw %} {{ content.post_body }}   {% endraw %} tag.

So my complete filter looks like

{% set modified_content = content.post_body|replace('<pre>', '<pre><raw>')|replace('</pre>', '<endraw></pre>')|replace('&lt;raw&gt;', '&#123;&#x25; raw &#x25;&#125;')|replace('&lt;endraw&gt;', '&#123;&#x25; endraw &#x25;&#125;') %}

That way when I need to talk about a <raw> opening tag I can type < raw > and when I need to talk about a <endraw> closing tag, I can type < endraw > 

{%- endset -%} {%- set hs_blog_post_summary -%}
This will be fairly niche. I'm mostly publishing it to impress Stephanie.
{%- endset -%} {%- blog_post_data_wall_wrapper body={{hs_blog_post_body}}, summary={{hs_blog_post_summary}} %}

 
Using this method, I can then use the <pre><raw><raw> tags which are built into the blog editor to add my code as usual, but now those <pre><raw><raw> tags automatically include raw tags like
<pre><raw><raw><raw><endraw><endraw><endraw></pre>
 

Nerdy PostScript

Just in case you need to know, to be able to include <raw> and <endraw> in the text of this post I also needed to create some filters for the {{ content.post_body }}    tag.

So my complete filter looks like

That way when I need to talk about a <raw> opening tag I can type < raw > and when I need to talk about a <endraw> closing tag, I can type < endraw > 



 
Using this method, I can then use the <pre> tags which are built into the blog editor to add my code as usual, but now those <pre> tags automatically include raw tags like
<pre><raw><endraw></pre>
 

Nerdy PostScript

Just in case you need to know, to be able to include <raw> and <endraw> in the text of this post I also needed to create some filters for the {{ content.post_body }}    tag.

So my complete filter looks like

That way when I need to talk about a <raw> opening tag I can type < raw > and when I need to talk about a <endraw> closing tag, I can type < endraw > 



 
Using this method, I can then use the <pre><raw> tags which are built into the blog editor to add my code as usual, but now those <pre><raw> tags automatically include raw tags like
<pre><raw><raw><endraw><endraw></pre>
 

Nerdy PostScript

Just in case you need to know, to be able to include <raw> and <endraw> in the text of this post I also needed to create some filters for the {{ content.post_body }}    tag.

So my complete filter looks like

That way when I need to talk about a <raw> opening tag I can type < raw > and when I need to talk about a <endraw> closing tag, I can type < endraw > 



 
Using this method, I can then use the <pre> tags which are built into the blog editor to add my code as usual, but now those <pre> tags automatically include raw tags like
<pre><raw><endraw></pre>
 

Nerdy PostScript

Just in case you need to know, to be able to include <raw> and <endraw> in the text of this post I also needed to create some filters for the {{ content.post_body }}    tag.

So my complete filter looks like

That way when I need to talk about a <raw> opening tag I can type < raw > and when I need to talk about a <endraw> closing tag, I can type < endraw > 



 
Using this method, I can then use the <pre><raw><raw> tags which are built into the blog editor to add my code as usual, but now those <pre><raw><raw> tags automatically include raw tags like
<pre><raw><raw><raw><endraw><endraw><endraw></pre>
 

Nerdy PostScript

Just in case you need to know, to be able to include <raw> and <endraw> in the text of this post I also needed to create some filters for the {{ content.post_body }}    tag.

So my complete filter looks like

That way when I need to talk about a <raw> opening tag I can type < raw > and when I need to talk about a <endraw> closing tag, I can type < endraw > 



 
Using this method, I can then use the <pre> tags which are built into the blog editor to add my code as usual, but now those <pre> tags automatically include raw tags like
<pre><raw><endraw></pre>
 

Nerdy PostScript

Just in case you need to know, to be able to include <raw> and <endraw> in the text of this post I also needed to create some filters for the {{ content.post_body }}    tag.

So my complete filter looks like

That way when I need to talk about a <raw> opening tag I can type < raw > and when I need to talk about a <endraw> closing tag, I can type < endraw > 



 
Using this method, I can then use the <pre><raw> tags which are built into the blog editor to add my code as usual, but now those <pre><raw> tags automatically include raw tags like
<pre><raw><raw><endraw><endraw></pre>
 

Nerdy PostScript

Just in case you need to know, to be able to include <raw> and <endraw> in the text of this post I also needed to create some filters for the {{ content.post_body }}    tag.

So my complete filter looks like

That way when I need to talk about a <raw> opening tag I can type < raw > and when I need to talk about a <endraw> closing tag, I can type < endraw > 



 
Using this method, I can then use the <pre> tags which are built into the blog editor to add my code as usual, but now those <pre> tags automatically include raw tags like
<pre><raw><endraw></pre>
 

Nerdy PostScript

Just in case you need to know, to be able to include <raw> and <endraw> in the text of this post I also needed to create some filters for the {{ content.post_body }}    tag.

So my complete filter looks like

That way when I need to talk about a <raw> opening tag I can type < raw > and when I need to talk about a <endraw> closing tag, I can type < endraw > 



 
Using this method, I can then use the <pre><raw><raw> tags which are built into the blog editor to add my code as usual, but now those <pre><raw><raw> tags automatically include raw tags like
<pre><raw><raw><raw><endraw><endraw><endraw></pre>
 

Nerdy PostScript

Just in case you need to know, to be able to include <raw> and <endraw> in the text of this post I also needed to create some filters for the {{ content.post_body }}    tag.

So my complete filter looks like

That way when I need to talk about a <raw> opening tag I can type < raw > and when I need to talk about a <endraw> closing tag, I can type < endraw > 



 
Using this method, I can then use the <pre> tags which are built into the blog editor to add my code as usual, but now those <pre> tags automatically include raw tags like
<pre><raw><endraw></pre>
 

Nerdy PostScript

Just in case you need to know, to be able to include <raw> and <endraw> in the text of this post I also needed to create some filters for the {{ content.post_body }}    tag.

So my complete filter looks like

That way when I need to talk about a <raw> opening tag I can type < raw > and when I need to talk about a <endraw> closing tag, I can type < endraw > 



 
Using this method, I can then use the <pre><raw> tags which are built into the blog editor to add my code as usual, but now those <pre><raw> tags automatically include raw tags like
<pre><raw><raw><endraw><endraw></pre>
 

Nerdy PostScript

Just in case you need to know, to be able to include <raw> and <endraw> in the text of this post I also needed to create some filters for the {{ content.post_body }}    tag.

So my complete filter looks like

That way when I need to talk about a <raw> opening tag I can type < raw > and when I need to talk about a <endraw> closing tag, I can type < endraw > 



 
Using this method, I can then use the <pre> tags which are built into the blog editor to add my code as usual, but now those <pre> tags automatically include raw tags like
<pre><raw><endraw></pre>
 

Nerdy PostScript

Just in case you need to know, to be able to include <raw> and <endraw> in the text of this post I also needed to create some filters for the {{ content.post_body }}    tag.

So my complete filter looks like

That way when I need to talk about a <raw> opening tag I can type < raw > and when I need to talk about a <endraw> closing tag, I can type < endraw >