Skip to content

Commit fa69769

Browse files
committed
CI 테스트 : 코드 포맷팅 커밋
1 parent 075ced1 commit fa69769

7 files changed

Lines changed: 81 additions & 76 deletions

File tree

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
class BoxComponent extends HTMLElement {
22
static get observedAttributes() {
3-
return ['imgsrc', 'href', 'title', 'description'];
3+
return ['imgsrc', 'href', 'title', 'description'];
44
}
55

66
constructor() {
7-
super();
7+
super();
88
}
99

1010
attributeChangedCallback() {
11-
this.render();
11+
this.render();
1212
}
1313

1414
connectedCallback() {
15-
this.render();
15+
this.render();
1616
}
1717

1818
render() {
19-
const imgSrc = this.getAttribute('imgsrc') || '';
20-
const href = this.getAttribute('href') || '/';
21-
const title = this.getAttribute('title') || '';
22-
const description = this.getAttribute('description') || '';
19+
const imgSrc = this.getAttribute('imgsrc') || '';
20+
const href = this.getAttribute('href') || '/';
21+
const title = this.getAttribute('title') || '';
22+
const description = this.getAttribute('description') || '';
2323

24-
this.innerHTML = `
25-
<div class="overflow-x-hidden shadow rounded bg-white mb-4 transition-all duration-200 hover:shadow hover:ring hover:ring-gray-200 hover:ring-1">
26-
<a href="${href}" class="no-underline decoration-none" style="text-decoration: none;">
27-
<div class="flex flex-col gap-2 p-4">
28-
<div class="flex gap-4 items-center">
29-
<img class="w-[32px]" src="${imgSrc}" alt="">
30-
<div class="text-xl font-semibold text-gray-800 dark:text-white flex items-center gap-2">${title}</div>
24+
this.innerHTML = `
25+
<div class="overflow-x-hidden shadow rounded bg-white mb-4 transition-all duration-200 hover:shadow hover:ring hover:ring-gray-200">
26+
<a href="${href}" class="no-underline decoration-none" style="text-decoration: none;">
27+
<div class="flex flex-col gap-2 p-4">
28+
<div class="flex gap-4 items-center">
29+
<img class="w-[32px]" src="${imgSrc}" alt="">
30+
<div class="text-xl font-semibold text-gray-800 dark:text-white flex items-center gap-2">${title}</div>
31+
</div>
32+
<div class="text-gray-600 dark:text-white font-normal" style="text-decoration: none;">${description}</div>
33+
</div>
34+
</a>
3135
</div>
32-
<div class="text-gray-600 dark:text-white font-normal" style="text-decoration: none;">${description}</div>
33-
</div>
34-
</a>
35-
</div>
3636
`;
3737
}
3838
}
3939

40-
customElements.define('box-component', BoxComponent);
40+
customElements.define('box-component', BoxComponent);
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
class ButtonComponent extends HTMLElement {
2-
static get observedAttributes() {
3-
return ['href', 'title'];
4-
}
2+
static get observedAttributes() {
3+
return ['href', 'title'];
4+
}
55

6-
constructor() {
7-
super();
8-
}
6+
constructor() {
7+
super();
8+
}
99

10-
attributeChangedCallback() {
11-
this.render();
12-
}
10+
attributeChangedCallback() {
11+
this.render();
12+
}
1313

14-
connectedCallback() {
15-
this.render();
16-
}
14+
connectedCallback() {
15+
this.render();
16+
}
1717

18-
render() {
19-
const href = this.getAttribute('href') || '#';
20-
const title = this.getAttribute('title') || '';
18+
render() {
19+
const href = this.getAttribute('href') || '#';
20+
const title = this.getAttribute('title') || '';
2121

22-
this.innerHTML = `
22+
this.innerHTML = `
2323
<button type="button" class="not-prose my-4">
2424
<a href="${href}" class="cursor-pointer py-2 px-4 rounded bg-[#086dd7] text-white!">
2525
${title}
2626
</a>
2727
</button>
2828
`;
29-
}
29+
}
3030
}
3131

32-
customElements.define('button-component', ButtonComponent);
32+
customElements.define('button-component', ButtonComponent);

src/scripts/components/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import './footer-component';
22
import './header-component';
33
import './box-component';
4-
import './button-component'
4+
import './button-component';

src/scripts/load_md.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { marked } from 'marked';
33
// ✅ marked 옵션 설정 (브레이크, GFM 지원 등)
44
marked.setOptions({
55
gfm: true,
6-
breaks: true
6+
breaks: true,
77
});
88

99
// ✅ box-component를 블록 태그로 처리하는 커스텀 토크나이저 추가
@@ -15,7 +15,7 @@ const blockTagRegex = new RegExp(
1515

1616
const customBlockTokenizer = {
1717
name: 'custom-block-tag',
18-
level: "block",
18+
level: 'block',
1919
start(src: string) {
2020
return src.match(blockTagRegex)?.index;
2121
},
@@ -38,8 +38,13 @@ marked.use({ extensions: [customBlockTokenizer] });
3838
* mdText를 웹 컴포넌트 태그(<box-component>, <button-component>) 기준으로 분할하여
3939
* 마크다운은 파싱하고, 웹 컴포넌트는 그대로 삽입하는 함수
4040
*/
41-
async function renderMarkdownWithComponents(mdText: string, contentElement: HTMLElement) {
42-
const tokens = mdText.split(/(<\/?box-component[^>]*>|<\/?button-component[^>]*>)/gi).filter(Boolean);
41+
async function renderMarkdownWithComponents(
42+
mdText: string,
43+
contentElement: HTMLElement
44+
) {
45+
const tokens = mdText
46+
.split(/(<\/?box-component[^>]*>|<\/?button-component[^>]*>)/gi)
47+
.filter(Boolean);
4348

4449
for (const token of tokens) {
4550
if (/^<\/?(box-component|button-component)[^>]*>$/.test(token)) {
@@ -69,7 +74,7 @@ async function loadMarkdown(page: string) {
6974
const contentElement = document.getElementById('content')!;
7075
contentElement.innerHTML = '';
7176
await renderMarkdownWithComponents(mdText, contentElement);
72-
} catch (error) {
77+
} catch {
7378
document.getElementById('content')!.innerHTML = `
7479
<div id="not-found" class="w-full">
7580
<p>페이지를 찾을 수 없습니다.</p>
@@ -80,6 +85,6 @@ async function loadMarkdown(page: string) {
8085
}
8186

8287
export async function initializeMarkdownLoader() {
83-
let page = location.hash ? location.hash.substring(2) : 'home';
88+
const page = location.hash ? location.hash.substring(2) : 'home';
8489
await loadMarkdown(page);
8590
}

src/styles/content_style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,4 @@ h4 {
133133
width: 100%;
134134
height: 100%;
135135
}
136-
}
136+
}

src/styles/not_found.css

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
11
.not-found {
2-
display: flex;
3-
flex-direction: column;
4-
justify-content: center;
5-
align-items: center;
2+
display: flex;
3+
flex-direction: column;
4+
justify-content: center;
5+
align-items: center;
66

7-
position: absolute;
8-
top: 50%;
9-
left: 50%;
10-
transform: translate(-50%, -50%);
7+
position: absolute;
8+
top: 50%;
9+
left: 50%;
10+
transform: translate(-50%, -50%);
1111

12-
text-align: center;
13-
padding: 20px;
14-
max-width: 600px;
15-
background: #fff;
16-
border: 1px solid #ddd;
17-
border-radius: 8px;
18-
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
12+
text-align: center;
13+
padding: 20px;
14+
max-width: 600px;
15+
background: #fff;
16+
border: 1px solid #ddd;
17+
border-radius: 8px;
18+
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
1919
}
2020

2121
.not-found h2 {
22-
color: #d9534f;
23-
font-size: 24px;
24-
margin-bottom: 10px;
22+
color: #d9534f;
23+
font-size: 24px;
24+
margin-bottom: 10px;
2525
}
2626

2727
.not-found p {
28-
font-size: 16px;
29-
color: #555;
28+
font-size: 16px;
29+
color: #555;
3030
}
3131

3232
.not-found .back-home {
33-
display: inline-block;
34-
margin-top: 10px;
35-
padding: 8px 15px;
36-
background: #007bff;
37-
color: white;
38-
text-decoration: none;
39-
border-radius: 4px;
33+
display: inline-block;
34+
margin-top: 10px;
35+
padding: 8px 15px;
36+
background: #007bff;
37+
color: white;
38+
text-decoration: none;
39+
border-radius: 4px;
4040
}
4141

4242
.not-found .back-home:hover {
43-
background: #0056b3;
44-
}
43+
background: #0056b3;
44+
}

src/styles/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
@layer base {
44
table {
5-
@apply table-auto w-3/4;
5+
@apply w-3/4 table-auto;
66
}
77

88
th,

0 commit comments

Comments
 (0)