Using wildcard for custom HTML tags in Rubymine - ruby-on-rails

I'm developing a lot of RadiantCMS applications, and this CMS uses custom radiant tags which are translated to content and html at runtime. So, my HTML templates have a markup like this:
<body>
<div class="content">
<r:content />
</div>
...
</body>
This is all fine, but Rubymine complains about all the <r:content /> tags being invalid html. The effect is that my html-templates are loaded with error-notifications.
I know that you can customize the Rubymine Inspections, and allow Custom HTML Tags, but there are almost unlimited <r:... /> tags available. To add all possibilities in the customtags field would be hours of work and not very flexible, because new tags come and go by the month.
What I want to do is pass in a wildcard for the r: so that all those tags are allowed as valid html tags. I tried some REGEX options but gave me no results.
Does anyone have experience with Rubymine Inspections and how to overcome this issue?

There is a feature to define inspections per Scope. You can add a new Scope for all your project files except these template files (they can be excluded either by directory or name pattern). Then in the Inspection settings you can add this scope and configure the inspection reporting invalid HTML tags to trigger only in the custom scope, not for all the files. As your templates with <r:... /> are excluded from this scope, inspection will not report such files.
It's not ideal, as it will not report other possibly invalid tags in the template files, but right now there is no way to ignore tags by pattern, but you can submit a feature request.

Related

Problem to input custom HTML with schema and JavaScript to individual page modx

I'm new on ModX. I've created a template variable to input custom HTML into my page. I choose Rich Text as input type for this template variable.
On the other hand, my HTML contains some meta tag like <meta itemprop="name" content="myname"> tag with schema ( some custom attributes like <div class="review" itemprop="review" itemscope="" itemtype="http://schema.org/Review"> )
So when I submit this data into page through template variable, I don't see that meta tag and custom attributes like itemprop, itemscope or script tag. They are removed or ignored by the editor.
Can someone tell me that how can I get rid from these issue? I will be great full for the help. Thanks.
There are two possible ways at least:
1) use textarea TV type instead rich text
2) it depends on your WYSIWYG editor, they allow you to exclude (not cut) the specified tags from processing

Eloqua form has `<eloqua />` tags inside input values

Eloqua is generating forms:
http://codepen.io/EightArmsHQ/pen/6dce8530a881a3c5795e822ffefe508b?editors=1000
But the output html looks like this:
<input value="<eloqua type='emailfield' syntax='LastName' />" class="field-size-top-large" />
I assumed that the value attribute was something that was then going to be replaced by some Eloqua JavaScript, but when I view it on the page with JavaScript, sure enough its still there:
How can I remove these tags? Is this a bug with Eloqua?
I managed to remove these. The <eloqua /> tags are inside the value field like that because they are used on Eloqua hosted pages – so for instance if the marketing team are creating a landing or targeted page inside of Eloqua, or a page that is linked to from an Eloqua email. They only work on these Eloqua pages, not in self hosted forms.
If you are going to self host these forms (for example on your own website), here are the steps you can take to remove the tags:
Click the field
Click on the merge settings button
Select None
Note that the yellow disappears
Note that there is no longer a predefined value in the field

Thymleaf: Adding attribute in div tag

I need to add an attribute in with in div tag in thymleaf as follows
<div class="mp_snippet_address" itemscope itemtype="http://schema.org/LocalBusiness">
the problem is i could not define the itemscope in div tag
The standard HTML parser in Thymeleaf is a very strict XML parser. You can switch to the less-strict LEGACYHTML5 template mode (then include the nekoHTML 1.9.15+ as a dependency), which allows for 'boolean attributes', but the output may be slightly different than the input templates as I think it performs some kind of tag balancing to massage HTML5 into being well-formed XML.
Support for HTML as per the HTML spec is on the cards for Thymeleaf 3.0, but that version is still a very very very long way away.

multi line tag in grails or html

With a grails app and from a local database, I'm returning some text in a xml format.
I can return it well formed in a <textarea></textarea> tag with the correct indenting (tabulation, line return,...etc.)
I want to go a bit further. In the text I'm returning, there are some <img/> tags and I'd like to replace those tag by the real images themselves.
I searched around and found no solution as of now. I understood that you can't add an image to a textarea (other then in a background), and if I choose a div tag, I won't have the indenting anymore (and therefore, harder to read)
I was wondering if using a <g:textField/> or an other tag from the grails library will do the trick. And if so, How can I append them to a page using jquery.
For example, how to append a <g:textField/> in jquery. It doesn't interpret it and I get this error
SyntaxError: missing ) after argument list [Break On This Error]...+doc).append("<input type="text" id="FTMAP_"+nb_sec+"" ...
And in my javascript file, I have
$("#FTM_"+doc).append("<g:textField id='FTMAP_"+nb_sec+"' ... />
Any possible solutions ?
EDIT
I did forget to mention that my final intentions are to be able to modify the text (tags included) and to have a nice and neat indentation so that it is the easiest possible for the end user.
You are asking a few different questions:
1. Can I use a single HTML tag to include images inside pre-formatted text.
No. You will have to parse the text and translate it into styled text yourself.
2. Is there a tag in the grails standard tags to accomplish this for me?
No.
3. How can I add grails tags from my javascript code.
Grails tags are processed on the server-side, and javascript is processed on the client. This means you cannot directly add grails tags via javascript.
There are a couple methods that can accomplish the same result, however:
You can set a javascript variable to the rendered content of a grails tag. This solution is good for data that is known at the time of the initial request.
var tagOutput = "${g.textField(/* etc */)}";
You can make an ajax request for the content to be added. Then your server-side grails code can render the tags you need. This is better for realtime data, or data that will be updated more than once on a single rendered page.

Rendering html using Struts2

Using Struts2, my goal is to present a simple blog to a user using Struts2 iterators, such as:
Most Recent Topic
response 1
response 2
...
Previous Topic
response 1
response 2
...
Users generate and submit each Topic/Response using a separate form, but, once submitted, I don't want them to edit the blog.
To generate either a Topic or a Response, I provide an editor (like the stackoverflow editor I'm using now) that produces html-formatted text, including whatever styling (bold, underlines, lists, etc.) that the user chooses. The text of the Topic/Response created by the user, including the html tags, is stored in a database.
However, I cannot find a way to render the Topic/Response as html in the blog. For example, text bolded in the editor shows up as <strong>text</strong> in a struts2 s:textarea tag.
I know that the s:property tag has an 'escapeHtml' attribute that will prevent this, but the s:property tag can't layout the text properly, and it seems that only the s:property tag has this attribute.
I've tried using <input value="%{#topic.content}" /> within the iterator instead of s:textarea, but it doesn't seem to recognize the #topic iteration reference.
Is there a way to do this?
use text instated of tax area .Let me know if you still facing this issue.
Use escapeHtml="false". I just tried it myself and it works as intended.
For example, with:
<s:set var="var1"><p>some stuff</p><p>other stuff</p></s:set>
<s:property value="var1" escapeHtml="false" />
renders the paragraph tags as you would expect.
How about using <pre> with <s:property>.
About html <pre> tag:
http://www.w3schools.com/tags/tag_pre.asp

Resources