2

I find myself in the position of processing some unusual HTML from clipboard data created by MS Word.

My problem boils down to this: This works (returns none):

console.log($('<span style="mso-list:Ignore;display:none"></span>').css('display'))
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

This doesn't work (returns undefined):

console.log($('<span style="mso-list:Ignore"></span>').css('mso-list'))
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

Why is this not working (do they white-list the CSS statements?) and how can it be worked around? Do I have to parse the style attribute myself?

0

1 Answer 1

1

Here is a quick trick to get value of this property:

console.log($('<span style="mso-list:Ignore"></span>').attr('style').split('mso-list:').pop())
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.