multiple lines in blogs

This commit is contained in:
roswold 2021-06-17 08:08:49 -05:00
parent 5f5b18ab48
commit c3f484cb26
3 changed files with 16 additions and 1 deletions

View File

@ -2,6 +2,8 @@ project('rcms', 'c',
version : '0.1',
default_options : ['warning_level=3'])
add_project_arguments('-Wfatal-errors', language : 'c')
exe = executable('rcms',
'src/main.c',
'src/rcms.c',

View File

@ -193,7 +193,7 @@ void output_blogfile_rss(Rss*rss,char*fn)
}
// Read blog file, store in Rss fields
for(int i=0;i<4;++i)
for(int i=0;i<3;++i)
{
uint32_t sl=0;
@ -203,6 +203,17 @@ void output_blogfile_rss(Rss*rss,char*fn)
rss->strings[i][sl-1]=0;
}
fgets(rss->strings[3],1024,f);
while(strlen(rss->strings[3])<1024)
{
char ch[8]={fgetc(f),0};
if(*ch=='\n')
strcat(rss->strings[3],"</br>");
else
strcat(rss->strings[3],ch);
}
fclose(f);
printf("<h2>%s</h2>",rss->strings[0]);

View File

@ -2,3 +2,5 @@ Welcome to my website!
https://example.com/welcome.txt
https://example.com/welcome.txt
This is a test of my content management system, <a href="/rmcs.html">rcms</a>. I hope that this will be rendered correctly and we will get a good blog/news entry as well as an RSS entry. We shall see.
This is line 2 of the blog.
This is line 3 of the blog.