Skip to content

feat(replaceOuter) : Added replaceOuter property to replace the data-loc tag with the remote content or fragment#6

Open
jhaeyaert wants to merge 1 commit into
everwatchsolutions:masterfrom
jhaeyaert:master
Open

feat(replaceOuter) : Added replaceOuter property to replace the data-loc tag with the remote content or fragment#6
jhaeyaert wants to merge 1 commit into
everwatchsolutions:masterfrom
jhaeyaert:master

Conversation

@jhaeyaert

Copy link
Copy Markdown

This simple feature allows to replace the 'data-loc' tag with the remote content or fragment by default. If property is set to 'true', the actual behaviour is adopter (ie : include content into div tag).

That way, the final HTML will be clean of non necessary tags.

Ex :

Let's say that page-header-app is responsible to generate the following header html content :

<header>
   <div>...<div>
</header>

The page includes the header content using data-loc :

<html>
   <body>
      <div data-loc="http://page-header-app" />
   </body>
</html>

The old way of working will produce :

<html>
   <body>
      <div data-loc="http://page-header-app">
         <header>
            <div>...<div>
         </header>
      </div>
   </body>
</html>

The new way of working will now produce this cleaned result by default :

<html>
   <body>
      <header>
         <div>...<div>
      </header>
   </body>
</html>

@andrewserff

Copy link
Copy Markdown
Member

This looks good to me. I'll need to check to see if this breaks anything on our end since it changes the default output of the HTML, but I agree with your default as it makes it cleaner. I'll try to test and get this merged as soon as I can and release a new version. Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants