Skip to content

Commit

Permalink
Update load_experiences.js
Browse files Browse the repository at this point in the history
  • Loading branch information
KimTeddy committed Dec 23, 2024
1 parent 8869571 commit 82fb418
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions assets/js/load_experiences.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ document.addEventListener('DOMContentLoaded', () => {
.then(yamlText => {
const experiencesData = jsyaml.load(yamlText); // YAML 파싱
const experienceContainer = document.querySelector('.experience-container');

if (experiencesData.experiences) {
experiencesData.experiences.forEach(experienceGroup => {
experienceGroup.positions.forEach(position => {
Expand All @@ -19,7 +19,7 @@ document.addEventListener('DOMContentLoaded', () => {
position.responsibilities.forEach(responsibility => {
const listItem = document.createElement('li');

// 수상 내역 중 강조 부분만 <code>로 감싸기
// 수상 내역에서 이모티콘과 텍스트 분리 및 처리
const match = responsibility.match(/(.*? - )(.*?)(🏆|🥇|🥈|🥉|🎖️|✨)(.*)/);
if (match) {
const textPart1 = document.createTextNode(match[1]);
Expand All @@ -32,7 +32,8 @@ document.addEventListener('DOMContentLoaded', () => {
listItem.appendChild(emoji);
listItem.appendChild(textPart2);
} else {
listItem.textContent = responsibility; // 매칭 실패 시 전체 텍스트 출력
// 매칭 실패 시 전체 텍스트를 표시
listItem.textContent = responsibility;
}

awardList.appendChild(listItem);
Expand Down

0 comments on commit 82fb418

Please sign in to comment.