Im using channel tags to display content for an RSS feed. The issue is that the content has been imported and contains , which makes the feed fail validation and screws up in some readers.
Is their a way to strip out the ? I've 2 modules that can strip out markup but neither can remove the
http://supergeekery.com/geekblog/comments/expression_engine_2_plugin_supergeekery_tag_stripper_version_1.0
http://devot-ee.com/add-ons/html-plugin
Could this be done with some custom PHP?
Thanks
This answer on a similar question should help. Just run this query on the database to get rid of the non-breaking spaces altogether. (Use phpMyAdmin or similar.)
UPDATE exp_channel_data SET text_column = REPLACE(field_id_XX, ' ', ' ')
Replace field_id_XX with the actual name of your column(s).
Related
I have this NodeJS application, that uses Jade as template language. On one particular page, one text block is retrieved from the server, which reads the text from database.
The problem is, the returned text might contain line-breaks and links, and an operator might change this text at any time. How do I make these elements display correctly?
Most answers suggest using a new line:
p
| this is the start of the para
a(href='http://example.com') a link
| and this is the rest of the paragraph
But I cannot do this, since I cannot know when the a element appears. I've solved how to get newline correct, by this trick:
p
each l in line.description.split(/\n/)
= l
br
But I cannot seem to solve how to get links to render correctly. Does anyone know?
Edit:
I am open to any kind of format for links in the database, whatever would solve the issue. For example, say database contains the following text:
Hello!
We would like you to visit [a("http://www.google.com")Google]
Then we would like that to output text that looks like this:
Hello!
We would like you to visit Google
Looks like what you're looking for is unescaped string interpolation. The link does not work in the output because Pug automatically escapes it. Wrap the content you want to insert with !{} and it should stop breaking links. (Disclaimer: Make sure you don't leave user input unescaped - this only is a viable option if you know for sure the content of your DB does not have unwanted HTML/JS code in it.)
See this CodePen for illustration.
With this approach, you would need to use standard HTML tags (<a>) in your DB text. If you don't want that, you could have a look at Pug filters such as markdown-it (you will still need to un-escape the compilation output of that filter).
I am trying to replace the strings in my template
To do this ive done the following:
section = helper.Section("%course_name%", "Tekst");
mail.addSection(section);
section = helper.Section("%user%", "Textforasubstitutiontagofsection2");
mail.addSection(section);
However when i recieve the mail the strings are not replace and stand as the above picture
Can anyone tell me what im doing wrong?
You want to be using substitutions rather than sections in this case. section tags are meant to encapsulate groups of substitution tags. Docs for more info.
I'm designing a workflow in SharePoint designer that uses a HTTP web service step via GET method. I have used it successfully before but this time I think the issue is with the name of the list but I'm not sure how to fix it.
Now the original name of the list "Engineers' Items-Table". As you can see, there's an apostrophe in the name. So initially I tried the following url which returned 0 records:
https://<domain>/_api/web/lists/getbytitle('Engineers' Items-Table')/items/?$select=Id
Then I renamed the list to "Engineer Items-Table" and tried the url:
https://<domain>/_api/web/lists/getbytitle('Engineer Items-Table')/items/?$select=Id
which doesn't return any results either. I tried using escape character %27 instead of the apostrophe which is not working either. SharePoint doesn't throw any exception. Workflow completes without an issue but without returning any items from the list.
Really appreciate your input. Thanks.
Instead of using "%27" use " ' " as escape character.
https://<domain>/_api/web/lists/getbytitle('Engineers'' Items-Table')/items/?$select=Id
Renaming the list might not change the behaviour because what you'll be changing now will be only the display name.
Next keep the query simple remove select as a start once you start getting result add select and filters.
Use POSTMAN which is a Chrome extension helps you find the error quickly.
I'm using node.js mailer module to send email from node server. I used template file for that but I got all spaces trimmed when the message was sent. I tried to add '\n' at the end line of the template but it doesn't work also. Here is an example of template file:
Hi {{username}},\\n
Thanks for creating an account with us
I tried \n and \n , nothing all doesn't work. Any help?
Thanks,
nodemailer supports two types of templates, i.e. text and html (or templateFn() - case of loopback).
The option text is used for email clients which don't support HTML rendering so that \n should be used in this option for a new line.
On the contrary, you should swap \n with <br> in the option html.
Hope this would help you.
It's a known behavior, mustache is made to work with HTML templates, in HTML, new lines will be contracted as one space only.
You can try doing something like {{new_line}} instead your \\n, and define new_line: "\n\xA0" in your datas. \xA0 is the non-breakable space, it can separate line if you want to make two new lines.
An other solution is to not use the template, but just get the content of the file as text with fs.readFileSync(filename) and use a regexp to replace {{xxx}} by an object content.
I'm using phpFlickr to make this query:
$photos = $f->photos_search(array(
'tags'=>$tag,
'sort'=>'date-taken-desc',
'per_page'=>100,
'user_id'=>'me',
'privacy_filter'=>5,
'extras'=>'date_taken,tags,url_sq,description'
));
It's working great, except, I have some tags with spaces in them and I want to display them that way. Is it possible? Maybe I need to do a tag lookup first?
found it:
http://www.flickr.com/services/api/flickr.tags.getListUserRaw.html