RssFeeds has no format, only text.

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
12/14/2011 1:18:25 PM
Gravatar
Total Posts 46

RssFeeds has no format, only text.

Hi. joe

I use a RSS Feature, but it's content just plan text, has no format, I don't know why.

 

e.g:

when the post in blog is below:

////////////////////////////////////

hello!

world!

/////////////////////////////////

in rss, it will show as below:

////////////////////////////////

hello!world!

////////////////////////////////

what's the problem?  

It's my mistake that need set something?

Thanks!

12/14/2011 2:17:54 PM
Gravatar
Total Posts 18439

Re: RssFeeds has no format, only text.

Hi,

Can you reproduce the problem on our demo site so I can see it?

Thanks,

Joe

12/15/2011 12:03:59 AM
Gravatar
Total Posts 46

Re: RssFeeds has no format, only text.

Hi, joe

In demo site, has no problem!

but maybe because it use mssql, not use sqlce.

with sqlce,  when i input

////in Blog Begin/////

Hello!

World!

////in Blog End/////

In Sqlce's mp_RssFeedEntries table I see below:

////in mp_RssFeedEntries'Description  Begin/////

<p>
Hello!</p>
<p>
World!</p>
<br /><a href='http://www.ipw.com/test5.aspx'>Admin</a>&nbsp;&nbsp;<a href='http://www.ipw.com/test5.aspx'>...</a>

////in mp_RssFeedEntries'Description  End/////

I think it's ok, but before it show in FeedManagerModule.ascx, I see the below code

protected string FormatBody(string postBody, string postUrl)
{
........

return UIHelper.CreateExcerpt(postBody, config.ExcerptLength, "<a class='morelink' href='" + postUrl + "'" + onclick + ">" + moreLinkText + "</a>");

}

return UIHelper.CreateExcerpt(postBody, config.ExcerptLength, config.ExcerptSuffix);

in UIHelper.CreateExcerpt,  it use string result = SecurityHelper.RemoveMarkup(content);

in  RemoveMarkup

public static string RemoveMarkup(string text)
{
text = Regex.Replace(text, @"&nbsp;", " ", RegexOptions.IgnoreCase);
return Regex.Replace(text.Replace(" ", " "), @"<.+?>", "", RegexOptions.Singleline); // this line code remove all format
}

you can see, the above code, remove all <p> <br />.. <a>

then after FormatBody, the Description become

"\r\n\ttest5\r\nAdmin ..."


So, it because plan text, has no format or link.

Thanks!


12/15/2011 4:08:26 PM
Gravatar
Total Posts 18439

Re: RssFeeds has no format, only text.

This is not sql ce specific and it is just the way it currently works. I think you could duplicate the problem on the demo site by enabling excerpts for the blog feed.

If you enable excerpts for the blog feed and no excerpt exists for the post we generate one but we don't have a good way to generate an html excerpt, it would be difficult to implement one correctly so that we don't miss any closing tags, so we generate a plain text excerpt and that has no formatting.

You can manually create the excerpts for blog posts, there is a tab for this in th eblog editor when you have excerpts enabled.

I'm open to improving this if somone comes up with a safe and efficient way to generate an html exceprt of a specified length that doesn't miss any closing tags and doesn't chop words in the middle. But until we have something to do that we can only safely generate a plain text excerpt.

Best,

Joe

12/16/2011 12:13:30 AM
Gravatar
Total Posts 46

Re: RssFeeds has no format, only text.

hi, joe

I know now!

if i set Use Excerpt? = false then it' ok now,

Thanks!

3/20/2012 10:17:19 AM
Gravatar
Total Posts 36

Re: RssFeeds has no format, only text.

Joe,

Are you still working on generating HTML in excerpts? This would be really useful. 

3/20/2012 10:37:00 AM
Gravatar
Total Posts 18439

Re: RssFeeds has no format, only text.

yes I agree it would be useful, but I never said I was working on it, I'm not working on it and don't expect I will any time soon.

It is a tough nut to crack, I don't have any solution in mind for it. If someone else has an idea of a safe way to do it I'm open to their solution, so feel free to put one forth if you know of a solution that would do it correctly and produce well formed valid markup.

I cannot think of a feasible solution to do it correctly therefore I'm not working on it.

Best,

Joe

3/20/2012 10:41:39 AM
Gravatar
Total Posts 36

Re: RssFeeds has no format, only text.

Joe,

If we cannot generate HTML excerpts is there a way to create a manual read more break in CKEditor? 

I would like to show only the first 250 words of the blog posts (like a preview) then hit a read more ... link.  I can do this through excerpts; except that the excerpt strips out all the formatting and only generates plain text.  I would like to maintain the formatting in the first 250 words excerpt or the preview part of the blog post.   

A manual read more break would solve the problem, but I do not see anyway to set or insert that using the current editor.  Also a setting to create a preview of n of lines (like the excerpt) might work also.

Thanks

3/20/2012 10:50:14 AM
Gravatar
Total Posts 18439

Re: RssFeeds has no format, only text.

You can create manual excerpts in the blog by enabling excerpts in the blog feed the extra tab for excerpts will appear in the blog editor. This allows you to create html excerpts manually for blog posts so that we don't have to generate a plain text excerpt, then it can have any markup you want and the size of the excerpt is whatever you type in there.

Hope that helps,

Joe

3/20/2012 1:09:48 PM
Gravatar
Total Posts 36

Re: RssFeeds has no format, only text.

Thanks Joe,

That works for the feed, but not the actual blog post itself.  I would like to limit the actual blog posts to the first n characters.  If I turn on use excerpt it outputs the excerpt to the blog post as plain text, regardless of whether you are you typed anything in the excerpt editor.  The HTML excerpt text from the excerpt editor works fine on the actual feed, but does not output the same HTML text to the blog post.  The Blog post still gets the unformulated text.  It appears to me that the blog post is not reading any of the text typed into the excerpt editor, it is just automatically creating an excerpt from the actual blog text editor.  

In my blog excerpt settings I have "use excerpts" and "use excerpt in feed" checked.  HTML excerpt works for feed, but not blog post.  Perhaps I am missing an option?

I am not sure if that is a bug or by design. 

It sure would be simpler if we had a more option in the CKEditor like the Wordpress blogs have.

3/21/2012 9:17:49 AM
Gravatar
Total Posts 18439

Re: RssFeeds has no format, only text.

Enabling excerpts makes the post list show excerpts and it works with manually created excerpts so they can show html. If a manually created excerpt exists it does not automatically generate a plain text one in the post list it uses the manually created one.

The blog post detail must show the full post otherwise they would never be able to ready anything except the excerpt. The read more link goes to the full post so they can read the full post.

Are you using the latest version of mojoPortal?

You must sign in to post in the forums. This thread is closed to new posts.