#355 Does not highlight/copy line number in code table
Merged 8 years ago by pingou. Opened 8 years ago by sayanchowdhury.
sayanchowdhury/pagure ln-code-table  into  master

@@ -304,8 +304,15 @@ 

  

  .code_table tr .cell1{

      width: 20px;

+     -webkit-user-select: none;

+     -moz-user-select: none;

+     -ms-user-select: none;

+     user-select: none;

  }

  

+ .code_table tr .cell1 a::before {

+     content: attr(data-line-number);

+ }

  

  .git_links {

      padding-top: 3em;

file modified
+2 -2
@@ -83,7 +83,7 @@ 

          if filename and commit:

              output.append(

                  '<tr><td class="cell1">'

-                 '<a id="%(cnt)s" href="#%(cnt)s">%(cnt_lbl)s</a></td>'

+                 '<a id="%(cnt)s" href="#%(cnt)s" data-line-number="%(cnt_lbl)s"></a></td>'

                  '<td class="prc" data-row="%(cnt_lbl)s"'

                  ' data-filename="%(filename)s" data-commit="%(commit)s">'

                  '<p>'
@@ -102,7 +102,7 @@ 

          else:

              output.append(

                  '<tr><td class="cell1">'

-                 '<a id="%(cnt)s" href="#%(cnt)s">%(cnt_lbl)s</a></td>'

+                 '<a id="%(cnt)s" href="#%(cnt)s" data-line-number="%(cnt_lbl)s"></a></td>'

                  % (

                      {

                          'cnt': '%s_%s' % (index, cnt),

@@ -838,7 +838,7 @@ 

          self.assertEqual(output.status_code, 200)

          self.assertTrue('<section class="file_content">' in output.data)

          self.assertTrue(

-             '<tr><td class="cell1"><a id="_1" href="#_1">1</a></td>'

+             '<tr><td class="cell1"><a id="_1" href="#_1" data-line-number="1"></a></td>'

              in output.data)

          self.assertTrue(

              '<td class="cell2"><pre> bar</pre></td>' in output.data)
@@ -913,7 +913,7 @@ 

          self.assertEqual(output.status_code, 200)

          self.assertTrue('<section class="file_content">' in output.data)

          self.assertTrue(

-             '<tr><td class="cell1"><a id="_1" href="#_1">1</a></td>'

+             '<tr><td class="cell1"><a id="_1" href="#_1" data-line-number="1"></a></td>'

              in output.data)

          self.assertTrue(

              '<td class="cell2"><pre> barRow 0</pre></td>' in output.data)

no initial comment

Hi Sayan,

Would you mind rebasing your branch to avoid the merge commit?

Tested locally, this is great! Thanks man!!

Hi pingou,

I have rebased and pushed the ln-code-table branch.