Skip to content

Commit

Permalink
Adicionando quebra de linha nos posts e projetos
Browse files Browse the repository at this point in the history
  • Loading branch information
andreeluis committed Dec 2, 2023
1 parent 41de331 commit c0ecd86
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/forum/assets/js/posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async function showPost() {
document.querySelector('.autor').innerHTML = post.autor;


document.querySelector('.conteudo').innerHTML = `<p>${post.conteudo}</p>`;
document.querySelector('.conteudo').innerHTML = `<p>${post.conteudo.replaceAll('\n', '<br>')}</p>`;

document.querySelector('.comentarios').innerHTML = `${comentariosHTML}`;

Expand Down
14 changes: 14 additions & 0 deletions src/projetos/assets/css/projetos.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,17 @@
.itens-list article p.hard {
background-color: var(--light-red);
}


p.categoria {
display: inline-block;
padding: .3em .6em;
background-color: var(--grey);
color: var(--white);
font-weight: bold;
border-radius: .5vmax;
}

.conteudo {
margin: 2em 1em 0;
}
2 changes: 1 addition & 1 deletion src/projetos/assets/js/projeto.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async function showProject() {
document.querySelector('.autor').innerHTML = project.autor;


document.querySelector('.conteudo').innerHTML = `<p>${project.conteudo}</p>`;
document.querySelector('.conteudo').innerHTML = `<p>${project.conteudo.replaceAll('\n', '<br>')}</p>`;
} catch (error) {
console.error('Falha ao carregar e exibir os posts:', error);
}
Expand Down

0 comments on commit c0ecd86

Please sign in to comment.