Skip to content

Commit da3f9e9

Browse files
committed
merging all conflicts
2 parents 7f2d328 + 2020876 commit da3f9e9

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

1-js/02-first-steps/15-function-basics/4-pow/solution.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ function pow(x, n) {
1010
return result;
1111
}
1212

13-
let x = prompt("x?", '');
14-
let n = prompt("n?", '');
13+
let x = +prompt("x?", '');
14+
let n = +prompt("n?", '');
1515

1616
if (n < 1) {
1717
alert(`Power ${n} is not supported, use a positive integer`);

2-ui/99-ui-misc/01-mutation-observer/article.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,19 @@ mutationRecords = [{
128128
...
129129
```
130130

131+
<<<<<<< HEAD
131132
কোড কে পঠনযোগ্য এবং সুন্দরভাবে দেখাতে, আমরা আমাদের সাইটে একটি সিনট্যাক্স হাইলাইটিং লাইব্রেরী ব্যবহার করছি, যেমন [Prism.js](https://prismjs.com/)। সিনট্যাক্স হাইলাইটিং এর জন্য প্রিজমার একটি ফাংশন `Prism.highlightElem(pre)` কল করতে হয়, যা `pre` এলিমেন্টকে অবজার্ভ করে এবং ঐ এলিমেন্টের কোডের বৈশিষ্ট্যের উপর নির্ভর বিশেষ ট্যাগ এবং স্ট্যাইল সংযুক্ত করে, যেমন উপরের কোডে দেখুন।
132133

133134
এখন প্রশ্ন, কখন `Prism.highlightElem(pre)` মেথডটি কল করব? আমরা চাইলে ফাংশনটি `DOMContentLoaded` ইভেন্ট ট্রিগারে বা পেজের একদম নিচে স্ক্রিপটি সংযুক্ত করতে পারি, তাহল DOM রেডি হওয়ার পর আমরা `pre[class*="language"]` এলিমেন্টগুলো খুঁজে `Prism.highlightElem` কে কল করতে পারি:
135+
=======
136+
For better readability and at the same time, to beautify it, we'll be using a JavaScript syntax highlighting library on our site, like [Prism.js](https://prismjs.com/). To get syntax highlighting for above snippet in Prism, `Prism.highlightElement(pre)` is called, which examines the contents of such `pre` elements and adds special tags and styles for colored syntax highlighting into those elements, similar to what you see in examples here, on this page.
137+
138+
When exactly should we run that highlighting method? Well, we can do it on `DOMContentLoaded` event, or put the script at the bottom of the page. The moment our DOM is ready, we can search for elements `pre[class*="language"]` and call `Prism.highlightElement` on them:
139+
>>>>>>> 20208769e528337949e946f526534d61d38bac47
134140
135141
```js
136142
// highlight all code snippets on the page
137-
document.querySelectorAll('pre[class*="language"]').forEach(Prism.highlightElem);
143+
document.querySelectorAll('pre[class*="language"]').forEach(elem => Prism.highlightElement(elem));
138144
```
139145

140146
এ পর্যন্ত সব ঠিকঠাক তাই না? আমরা স্নিপেট প্রয়োগ হবে এমন এলিমেন্টগুলো খুঁজে বের করে তাদের জন্য সিনট্যাক্স হাইলাইটার ব্যবহার করব।
@@ -146,9 +152,15 @@ let article = /* fetch new content from server */
146152
articleElem.innerHTML = article;
147153
```
148154

155+
<<<<<<< HEAD
149156
এখন ধরুন `article` এর কন্টেন্টে কিছু কোড স্নিপেট আছে। যার জন্য আমাদের `Prism.highlightElem` কে কল করতে হবে, অন্যথায় আমরা সিনট্যাক্স হাইলাইটিং দেখব না.
150157

151158
**তাহলে কিভাবে ডায়নামিক্যালি লোড হওয়া আর্টিকেলের জন্য আমরা `Prism.highlightElem` কে কল করব?**
159+
=======
160+
The new `article` HTML may contain code snippets. We need to call `Prism.highlightElement` on them, otherwise they won't get highlighted.
161+
162+
**Where and when to call `Prism.highlightElement` for a dynamically loaded article?**
163+
>>>>>>> 20208769e528337949e946f526534d61d38bac47
152164
153165
আমরা চাইলে আর্টিকেল লোড হওয়ার পর এভাবে সংযুক্ত করতে পারি:
154166

@@ -158,7 +170,7 @@ articleElem.innerHTML = article;
158170

159171
*!*
160172
let snippets = articleElem.querySelectorAll('pre[class*="language-"]');
161-
snippets.forEach(Prism.highlightElem);
173+
snippets.forEach(elem => Prism.highlightElement(elem));
162174
*/!*
163175
```
164176

0 commit comments

Comments
 (0)