feat: 优化行内样式生成

This commit is contained in:
augushong
2025-10-04 10:37:03 +08:00
parent 23f6db5b48
commit bfe89fcdef

View File

@@ -289,6 +289,7 @@
$('.build-inlin-style').click(function () { $('.build-inlin-style').click(function () {
$('#post-content').find('p').each(function (index, elem) { $('#post-content').find('p').each(function (index, elem) {
$(elem).css('margin-bottom', '18px'); $(elem).css('margin-bottom', '18px');
$(elem).css('line-height', '1.8');
}); });
$('#post-content').find('h1,h2,h3,h4,h5,h6').each(function (index, elem) { $('#post-content').find('h1,h2,h3,h4,h5,h6').each(function (index, elem) {
@@ -306,12 +307,31 @@
$(elem).css('font-weight', 'bold'); $(elem).css('font-weight', 'bold');
$(elem).css('margin-top', '18px'); $(elem).css('margin-top', '18px');
$(elem).css('margin-bottom', '8px'); $(elem).css('margin-bottom', '8px');
}); });
// ul,ol // ul,ol
$('#post-content').find('ul,ol').each(function (index, elem) { $('#post-content').find('ul,ol').each(function (index, elem) {
$(elem).css('margin-bottom', '18px'); $(elem).css('margin-bottom', '18px');
}); });
// 代码code
$('#post-content').find('pre').each(function (index, elem) {
$(elem).css('margin-bottom', '8px');
$(elem).css('font-size', '14px');
$(elem).css('padding', '2px 5px');
$(elem).css('background-color', '#f5f5f5');
$(elem).css('border', '1px solid #ddd');
$(elem).css('border-radius', '2px');
$(elem).css('color', '#333');
$(elem).css('margin-right', '8px');
$(elem).css('margin-left', '8px');
$(elem).css('white-space', 'pre-wrap');
$(elem).css('word-break', 'break-all');
$(elem).css('overflow-x', 'auto');
$(elem).css('tab-size', '4');
});
}); });
function copyContent(id) { function copyContent(id) {