multiple lines in blogs
This commit is contained in:
parent
5f5b18ab48
commit
c3f484cb26
@ -2,6 +2,8 @@ project('rcms', 'c',
|
|||||||
version : '0.1',
|
version : '0.1',
|
||||||
default_options : ['warning_level=3'])
|
default_options : ['warning_level=3'])
|
||||||
|
|
||||||
|
add_project_arguments('-Wfatal-errors', language : 'c')
|
||||||
|
|
||||||
exe = executable('rcms',
|
exe = executable('rcms',
|
||||||
'src/main.c',
|
'src/main.c',
|
||||||
'src/rcms.c',
|
'src/rcms.c',
|
||||||
|
13
src/rcms.c
13
src/rcms.c
@ -193,7 +193,7 @@ void output_blogfile_rss(Rss*rss,char*fn)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Read blog file, store in Rss fields
|
// 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;
|
uint32_t sl=0;
|
||||||
|
|
||||||
@ -203,6 +203,17 @@ void output_blogfile_rss(Rss*rss,char*fn)
|
|||||||
rss->strings[i][sl-1]=0;
|
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);
|
fclose(f);
|
||||||
|
|
||||||
printf("<h2>%s</h2>",rss->strings[0]);
|
printf("<h2>%s</h2>",rss->strings[0]);
|
||||||
|
@ -2,3 +2,5 @@ Welcome to my website!
|
|||||||
https://example.com/welcome.txt
|
https://example.com/welcome.txt
|
||||||
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 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.
|
||||||
|
Loading…
Reference in New Issue
Block a user