UIWebview URL handling - html

I have a UIWebview wherein I feed different kinds of text like links, simple text, emoticons. It is customize that it will chop a long link into several chunks for eg.
https://fbcdn-sphotos-d-a.akamaihd.net/hphotos-ak-ash3/s480x480/525188_10200372945753969_1256081282_n.jpg
into
https://fbcdn-sphotos-</BR>
d-a.akamaihd.net/hphot</BR>
os-ak-ash3/s480x480/52</BR>
5188_10200372945753969</BR>
_1256081282_n.jpg
I tried removing the method that chops it into several chunks but this is what I get...
https://fbcdn-sphotosd-
a.akamaihd.net/hphotos-ak-
ash3/s480x480/525188_10200372945753969_1256081282_n.jpg
The link is full and working, however on the UI it doesn't display correctly, if only it would automatically create a new line without breaking the link...
So the problem is that because there is a trailing html element the link automatically gets broken my question is...
Is there a way to handle such scenario wherein I can include the HTML element tags into the link yet doesn't break the link or better yet just make the long link display correctly?

Related

Remove html/text from RSS feed description except images

I am setting up a blog with WordPress, that uses a plugin to import RSS feeds and automatically publish them to the blog, on a schedule.
I only want to pull the images from the descriptions, not the text that sometimes appears with them, or other html elements.
There could be multiple images in a post, each one with captions, or links.
Ideally I'd like to use Yahoo Pipes to grab the feed, then use regex operator to replace everything with blank except <img> elements. Then send the manipulated feed to the WP plugin.
I've only managed to strip paragraphs so far, using: <p>.*?</p>. But in some cases there is plain text not wrapped in tags, etc.
Any help appreciated :) I'm a bit of a regex newbie.
you can try with this to get all images from html code.
preg_match_all('/<img[^>]+>/i',$html, $allimages);
print_r($allimages);
if you want image to be stored in string format then implode it with ,

HTML page title: localization and empty title

2 questions about a better way of solving the problem:
1) is there is a way to make HTML page title looking different for different locales of the client-side code except for javascript?
I.e. write HTML page title which is shown in the browser's tab in corresponding language.
I know I can use javascript for this, but may be there is another way?
2)I set my HTML page header with javascript (it is a different case). But there is a delay before the script will run. Is there is a way to set HTML page header to empty line before javascript evaluates?
If I remove tag I get the page URL.
If I use empty tag - same thing.
I have to use &nbsp content inside which looks a bit ugly.
Some other options?
I don't see any other means but JavaScript on the client side for this, sorry.
For the delay: try using an inline javascript to change the page title right on top of the page before any other scripts are loaded or executed, but after the page title has been set. This should keep the delay to an absolute minimum.
To the first:
Except Javascript, the only Way i know would be PHP, but using Javascript is a lot better and
easier.
To the second:
arkascha's Post is the answer

HTML - insert user-created HTML into a HTML page: escaping and discarding format

I have an HTML page which needs to display some HTML generated by the user on the Administration area (like a blog, for instance). The problem is that the user sometimes needs to copy-paste tables and other "garbage" content from Word/Excel to the WYSIWYG editor (that has the proper "paste from Word" function). This causes the resulting HTML code to be very dirty.
It wouldn't be a problem unless some of these pages are shown totally wrong: other divs AFTER user's HTML code are not in their supposed position, floats are not respected... etc...
I tried putting a div:
<div style="clear: both;"></div>
without success. I even tried with iFrames, but iFrames accept only external webpages (if applicable...).
The question is: is there any tag or method to put a part of an HTML code inside a webpage discarding all formatting AFTER this code?
Thank you.
To my knowledge, you simply want to end all divs. HTML is a very simple code, with very simple options. Your example doesn't work because HTML isn't that advances. You can either start a function <...> or end a function .
Ideally what you want is a piece of code that puts their work in a separate frame entirely, so as soon as the page passes their code, it goes back to the correct formatting.
Or, you could be really sloppy and put one hundred 's in, just in case.

Keeping links in SimplePie description

I am using SimplePie to feed blog entries to a non-Wordpress website. By default it strips out all HTML tags, but there is a way to keep them in, by inserting this code near the top of your page:
$feed->strip_htmltags(false);
$feed->init();
$feed->handle_content_type();
However this doesn't seem to be working. The links are present in my feed reader, so I don't believe the problem is with the feed itself, rather with the way I'm using SimplePie. Has anyone else encountered this issue, and found a solution? Thanks.
By default it strips out all HTML tags
Actually, it uses a blacklist to strip certain tags, but it does not strip links (a elements). If links are not appearing, then likely you're accessing the content wrong, or something else is stripping them.
One possibility for why this is occurring is that you're accessing the summary of the item instead of the content.

Can I word wrap a URL inside a HTML hyperlink

Is there a way to separate the URL name in a hyperlink so it continues onto the next line? In the application I am using I need to use a long URL and the space is limited so it wraps around to the next line. However, a space is automatically added to it and the link is then broken. Is there a continuation character to tell the application to keep link together or a way to use a shorter variable name that contains the longer actual URL?
No, HTML treats any and all whitespace characters (including multiple series of them) as a single space. You cannot disable this.
Is it absolutely necessary to put the URL as the hyperlink text?
In fact, showing a shorter meaningful description about the URL would be better for the hyperlink text.
meaning descr
I don't the actual requirement, but thought to leave this comment for you.