DEV Community

Cover image for About merge and commit

Posted on

About merge and commit


In Professor's Lab 3, I have a list of 4 suggested things to do this week: add a flag when creating the lang attribute on the root element, add a 0 when appropriate, and a -1 terminating error code when not in the inline <code> blocks. I found that I had to choose between adding awareness support for , and adding support for horizontal lines in Markdown and implement it.

Pick 2 of them

Therefore, among them, number 3, which supports inline <code>, which has already been implemented in code of the same classmates in the previous lab, and number 4, which supports the horizontal line of Markdown, was selected. It's probably because I wanted to further refine the part that actually looked when converting Markdown to HTML.


After deciding which part to do, I followed the sequence given in Lab 3. First, I went to My Repo and left an issue to add a function that recognizes the corresponding <code> and a function that recognizes <hr/>.

During the processing...

In creating issues and actually completing them, I paradoxically started issue-13 before issue-12.

First Commit

Because, to put it bluntly, replacing issue-13 --- with <hr/> was easier than recognizing issue-12's <code>. In this part, I solved the problem by adding a detection condition of --- to the existing switch:case part more easily than I thought.

else if(e.startsWith("---")){
                    return `<hr/>${delimiter}`
Enter fullscreen mode Exit fullscreen mode

After that, the commit proceeded. However, there were cases where the code did not work due to the text format of the Readme file, so unfortunately the Readme file was also slightly edited.

Second Commit and Merge

I can honestly say that the second commit was the most disappointing part of the OSD600 process (╬ Ò ‸ Ó). This is partly because the 'left quote' part was not recognized properly, and it was also very difficult to distinguish the 'left quote' at the beginning from the 'left quote' at the end. <code> didn't work as well, so I had to import the old <xmp> code and use it! However, fortunately, the problem of 'left quote' recognition has been solved as shown below, and the problem of <code> output not working properly has also been solved by using <xmp>.

else if (e.startsWith('```

     return `${e.replace('```', '<xmp>')}${delimiter}`;
}else if (e.endsWith('```')){
     return `${e.replace('

```', '</xmp>')}${delimiter}`;
Enter fullscreen mode Exit fullscreen mode

After that, I proceeded with the second commit, and since it was successfully completed, I immediately proceeded with the merge and completed this lab 3 without any problems.

With closing...

Lab 3 was definitely difficult and time consuming. In particular, the part where the 'left quote' of Markdown was imported as <code> or <xmp> of html was a series of hardships. I also realized that committing too much and the order of commits before merging is very important. (I made a mistake in commit and re-executed it in order through the git log) However, I can say that it was very worthwhile now to solve all of that and write the lab 3 report happily and lightly, and it was a valuable time to elevate my self-confidence to the next level. (๑˃̵ᴗ˂̵)و

Top comments (0)